From 50f99e361774c36bf995bf0f566a7d7b4ed4caa2 Mon Sep 17 00:00:00 2001 From: Paolo Gatti Date: Wed, 11 Jan 2023 15:08:30 +0000 Subject: [PATCH] [FIX] l10n_it_edi: fix buyers' codice fiscale in the template Just like the seller's codice fiscale is always shown in the FatturaPA XML if present on the partner, so should be the one from the buyer. If it's not, then when a company is a part of a fiscal group sharing the same VAT number and different Tax Codes, the SDI will reject the XML because the VAT number won't be enough for the Tax Agency to identify the company. There is no damage in showing the Codice Fiscale when the VAT is also there. opw-3114115 closes odoo/odoo#110307 X-original-commit: db5ce853e15b5003771c4811302dbff6e3cc054b Signed-off-by: Josse Colpaert Signed-off-by: Paolo Gatti (pgi) --- addons/l10n_it_edi/data/invoice_it_template.xml | 3 +-- addons/l10n_it_edi/tests/common.py | 2 +- addons/l10n_it_edi/tests/expected_xmls/IT00470550013_basis.xml | 1 + addons/l10n_it_edi/tests/expected_xmls/reverse_charge_bill.xml | 1 + .../l10n_it_stock_ddt/tests/expected_xmls/deferred_invoice.xml | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/l10n_it_edi/data/invoice_it_template.xml b/addons/l10n_it_edi/data/invoice_it_template.xml index 2582c8b2aad..cb07e0c58c6 100644 --- a/addons/l10n_it_edi/data/invoice_it_template.xml +++ b/addons/l10n_it_edi/data/invoice_it_template.xml @@ -119,8 +119,7 @@ - - + diff --git a/addons/l10n_it_edi/tests/common.py b/addons/l10n_it_edi/tests/common.py index c00c378a346..d86a23de3f4 100644 --- a/addons/l10n_it_edi/tests/common.py +++ b/addons/l10n_it_edi/tests/common.py @@ -47,7 +47,7 @@ class TestItEdi(AccountEdiTestCommon): cls.italian_partner_a = cls.env['res.partner'].create({ 'name': 'Alessi', 'vat': 'IT00465840031', - 'l10n_it_codice_fiscale': '00465840031', + 'l10n_it_codice_fiscale': '93026890017', 'country_id': cls.env.ref('base.it').id, 'street': 'Via Privata Alessi 6', 'zip': '28887', diff --git a/addons/l10n_it_edi/tests/expected_xmls/IT00470550013_basis.xml b/addons/l10n_it_edi/tests/expected_xmls/IT00470550013_basis.xml index 2eea78d701a..113f4551b4b 100644 --- a/addons/l10n_it_edi/tests/expected_xmls/IT00470550013_basis.xml +++ b/addons/l10n_it_edi/tests/expected_xmls/IT00470550013_basis.xml @@ -36,6 +36,7 @@ IT 00465840031 + 93026890017 Alessi diff --git a/addons/l10n_it_edi/tests/expected_xmls/reverse_charge_bill.xml b/addons/l10n_it_edi/tests/expected_xmls/reverse_charge_bill.xml index 121b425f22d..c0718372278 100644 --- a/addons/l10n_it_edi/tests/expected_xmls/reverse_charge_bill.xml +++ b/addons/l10n_it_edi/tests/expected_xmls/reverse_charge_bill.xml @@ -35,6 +35,7 @@ IT 01234560157 + 01234560157 company_2_data diff --git a/addons/l10n_it_stock_ddt/tests/expected_xmls/deferred_invoice.xml b/addons/l10n_it_stock_ddt/tests/expected_xmls/deferred_invoice.xml index e69757fab72..f5336ecc305 100644 --- a/addons/l10n_it_stock_ddt/tests/expected_xmls/deferred_invoice.xml +++ b/addons/l10n_it_stock_ddt/tests/expected_xmls/deferred_invoice.xml @@ -36,6 +36,7 @@ IT 00465840031 + 93026890017 Alessi