[FIX] account_edi_ubl_cii: handle fixed taxes in UBL/CII
Use case: the eco-taxes (recupel, auvibel, etc) are fixed taxes in Odoo, which apply before the "regular" (percentage) tax on an invoice line. We can have one or more fixed taxes and 1 regular tax. In EN16931, there can only be 1 tax per invoice line. Thus, the fixed taxes are encoded as charge on the invoice lines (with reason code `AEO`: "Collection and recycling"). The tags `AllowanceCharge` (in UBL) and `SpecifiedTradeAllowanceCharge` (in CII) are used. Then a serie of tax related infos need to be changed: the taxes in UBL/CII should not contain the fixed ones and the total untaxed amount needs to be adapted, as well as the total tax amount (since the fixed taxes were removed). To be able to import the fixed taxes back in Odoo, the charges on the invoice lines are read and their names and amounts are used to search on the existing taxes. task-3274208 closes odoo/odoo#122518 X-original-commit: 891f3a1a Signed-off-by:Laurent Smet <las@odoo.com>
Showing
- addons/account_edi/models/account_move.py 2 additions, 4 deletionsaddons/account_edi/models/account_move.py
- addons/account_edi_ubl_cii/data/cii_22_templates.xml 16 additions, 4 deletionsaddons/account_edi_ubl_cii/data/cii_22_templates.xml
- addons/account_edi_ubl_cii/models/account_edi_common.py 49 additions, 2 deletionsaddons/account_edi_ubl_cii/models/account_edi_common.py
- addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py 49 additions, 9 deletions...account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py
- addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py 65 additions, 40 deletionsaddons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
- addons/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py 3 additions, 3 deletions...ns/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py
- addons/account_edi_ubl_cii/models/account_edi_xml_ubl_nlcius.py 2 additions, 2 deletions.../account_edi_ubl_cii/models/account_edi_xml_ubl_nlcius.py
- addons/l10n_account_edi_ubl_cii_tests/tests/common.py 21 additions, 0 deletionsaddons/l10n_account_edi_ubl_cii_tests/tests/common.py
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/bis3_ecotaxes_case1.xml 132 additions, 0 deletions..._tests/tests/test_files/from_odoo/bis3_ecotaxes_case1.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/bis3_ecotaxes_case2.xml 138 additions, 0 deletions..._tests/tests/test_files/from_odoo/bis3_ecotaxes_case2.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/bis3_ecotaxes_case3.xml 132 additions, 0 deletions..._tests/tests/test_files/from_odoo/bis3_ecotaxes_case3.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/facturx_ecotaxes_case1.xml 152 additions, 0 deletions...sts/tests/test_files/from_odoo/facturx_ecotaxes_case1.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/facturx_ecotaxes_case2.xml 160 additions, 0 deletions...sts/tests/test_files/from_odoo/facturx_ecotaxes_case2.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_files/from_odoo/facturx_ecotaxes_case3.xml 152 additions, 0 deletions...sts/tests/test_files/from_odoo/facturx_ecotaxes_case3.xml
- addons/l10n_account_edi_ubl_cii_tests/tests/test_xml_cii_fr.py 81 additions, 0 deletions...s/l10n_account_edi_ubl_cii_tests/tests/test_xml_cii_fr.py
- addons/l10n_account_edi_ubl_cii_tests/tests/test_xml_ubl_be.py 84 additions, 1 deletion...s/l10n_account_edi_ubl_cii_tests/tests/test_xml_ubl_be.py
Loading