[FIX] {l10n_}account_edi_ubl_cii{_tests}: handle price_include taxes
In Factur-X, there is no way to represent a tax "price_include" because every amounts should be tax excluded. Currently in Factur-X, a line with a tax price_include = True will be incorrectly exported. Indeed, the Factur-X.xml is generated by setting the GrossPriceProduct as the price_unit. In Factur-X, this amount (and the others in the line details) should be tax excluded. Thus, it's wrong to set the GrossPriceProduct as the price_unit. To fix this, the GrossPriceProduct should be the price_unit if no tax price_include = True is set, otherwise, the gross price = price_unit/(1+tax/100). This way, the Factur-X file will be consistent with the norm. Note that the import of a Factur-X xml will thus try to pick taxes with price_include = False, and the price_unit will be tax excluded. If no matching tax with price_include = False is retrieved, a tax with price_include = True is searched, if found, the price_unit is recomputed accordingly. In both cases, the lines subtotals are the same. opw-3032382 closes odoo/odoo#106465 X-original-commit: 649e0f2d Signed-off-by:William André (wan) <wan@odoo.com> Signed-off-by:
Julien Van Roy <juvr@odoo.com>
Showing
- addons/account_edi_facturx/data/facturx_templates.xml 1 addition, 1 deletionaddons/account_edi_facturx/data/facturx_templates.xml
- addons/account_edi_ubl_cii/data/cii_22_templates.xml 5 additions, 13 deletionsaddons/account_edi_ubl_cii/data/cii_22_templates.xml
- addons/account_edi_ubl_cii/models/account_edi_common.py 56 additions, 11 deletionsaddons/account_edi_ubl_cii/models/account_edi_common.py
- addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py 3 additions, 25 deletions...account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py
- addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py 3 additions, 27 deletionsaddons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
- addons/l10n_account_edi_ubl_cii_tests/tests/common.py 8 additions, 0 deletionsaddons/l10n_account_edi_ubl_cii_tests/tests/common.py
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/facturx_out_invoice.xml 0 additions, 7 deletions..._tests/tests/test_files/from_odoo/facturx_out_invoice.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/facturx_out_invoice_tax_incl.xml 239 additions, 0 deletions...sts/test_files/from_odoo/facturx_out_invoice_tax_incl.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/facturx_out_refund.xml 0 additions, 7 deletions...i_tests/tests/test_files/from_odoo/facturx_out_refund.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_xml_cii_fr.py 107 additions, 0 deletions...s/l10n_account_edi_ubl_cii_tests/tests/test_xml_cii_fr.py
Loading