From 8533c7d86e6ebb3524ea3cc7e9b59e48592154c4 Mon Sep 17 00:00:00 2001 From: "Dylan Kiss (dyki)" Date: Mon, 20 Nov 2023 16:41:37 +0000 Subject: [PATCH] [FIX] l10n_es{_edi_facturae}{_adm_centers}: add administrative centers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently it's not possible to send facturae invoices through FACe, since we did not include administrative centers in the XML. This commit fixes that by: - Introducing a new partner type for Administrative Centers, with the necessary fields - Adding all Administrative Centers linked to a partner on the facturae electronic invoice Since often the three required Administrative Centers (Fiscal, Receiver and Payer) are the same, we allow the user to specify multiple roles on an Administrative Center. Demo data was also added for the Administrative Centers and updated to pass the facturae validator. For stable versions, we use a patch module to not break things. This should be moved to the main module in master. task-3599447 closes odoo/odoo#146675 X-original-commit: 7c4e846f023f92f48ee465008769848075757a29 Signed-off-by: William André (wan) Signed-off-by: Dylan Kiss (dyki) --- addons/l10n_es/demo/demo_company.xml | 1 + addons/l10n_es_edi_facturae/__manifest__.py | 2 +- .../data/facturae_templates.xml | 32 +- addons/l10n_es_edi_facturae/i18n/es.po | 651 ++++++++++++++++++ .../i18n/l10n_es_edi_facturae.pot | 216 +++--- .../models/account_move.py | 44 +- addons/l10n_es_edi_facturae/models/uom_uom.py | 1 + .../data/expected_in_invoice_document.xml | 8 +- .../tests/data/expected_refund_document.xml | 26 +- .../tests/data/expected_signed_document.xml | 10 +- .../tests/data/expected_tax_withholding.xml | 4 +- .../tests/data/import_multiple_invoices.xml | 4 +- .../tests/data/import_withholding_invoice.xml | 4 +- .../wizard/account_move_reversal.py | 28 +- .../__init__.py | 1 + .../__manifest__.py | 24 + .../data/facturae_templates.xml | 40 ++ ..._edi_facturae_adm_centers.ac_role_type.csv | 10 + .../demo/l10n_es_edi_facturae_demo.xml | 36 + .../i18n/es.po | 255 +++++++ .../i18n/l10n_es_edi_facturae_adm_centers.pot | 219 ++++++ .../models/__init__.py | 2 + .../models/account_move.py | 37 + .../models/res_partner.py | 61 ++ .../security/ir.model.access.csv | 3 + .../tests/__init__.py | 1 + .../tests/data/expected_ac_document.xml | 267 +++++++ .../tests/test_edi_xml.py | 54 ++ .../views/res_partner_views.xml | 21 + 29 files changed, 1873 insertions(+), 189 deletions(-) create mode 100644 addons/l10n_es_edi_facturae/i18n/es.po create mode 100644 addons/l10n_es_edi_facturae_adm_centers/__init__.py create mode 100644 addons/l10n_es_edi_facturae_adm_centers/__manifest__.py create mode 100644 addons/l10n_es_edi_facturae_adm_centers/data/facturae_templates.xml create mode 100644 addons/l10n_es_edi_facturae_adm_centers/data/l10n_es_edi_facturae_adm_centers.ac_role_type.csv create mode 100644 addons/l10n_es_edi_facturae_adm_centers/demo/l10n_es_edi_facturae_demo.xml create mode 100644 addons/l10n_es_edi_facturae_adm_centers/i18n/es.po create mode 100644 addons/l10n_es_edi_facturae_adm_centers/i18n/l10n_es_edi_facturae_adm_centers.pot create mode 100644 addons/l10n_es_edi_facturae_adm_centers/models/__init__.py create mode 100644 addons/l10n_es_edi_facturae_adm_centers/models/account_move.py create mode 100644 addons/l10n_es_edi_facturae_adm_centers/models/res_partner.py create mode 100644 addons/l10n_es_edi_facturae_adm_centers/security/ir.model.access.csv create mode 100644 addons/l10n_es_edi_facturae_adm_centers/tests/__init__.py create mode 100644 addons/l10n_es_edi_facturae_adm_centers/tests/data/expected_ac_document.xml create mode 100644 addons/l10n_es_edi_facturae_adm_centers/tests/test_edi_xml.py create mode 100644 addons/l10n_es_edi_facturae_adm_centers/views/res_partner_views.xml diff --git a/addons/l10n_es/demo/demo_company.xml b/addons/l10n_es/demo/demo_company.xml index a9254e001df..631fae8974e 100644 --- a/addons/l10n_es/demo/demo_company.xml +++ b/addons/l10n_es/demo/demo_company.xml @@ -1,6 +1,7 @@ + ES Company ES59962470K A diff --git a/addons/l10n_es_edi_facturae/__manifest__.py b/addons/l10n_es_edi_facturae/__manifest__.py index d41fc029101..12e2ffda930 100644 --- a/addons/l10n_es_edi_facturae/__manifest__.py +++ b/addons/l10n_es_edi_facturae/__manifest__.py @@ -8,7 +8,7 @@ 'description': """ This module create the Facturae file required to send the invoices information to the General State Administrations. It allows the export and signature of the signing of Facturae files. -The current version of Facturae supported is the 3.2.1 +The current version of Facturae supported is the 3.2.2 for more informations, see https://www.facturae.gob.es/face/Paginas/FACE.aspx """, diff --git a/addons/l10n_es_edi_facturae/data/facturae_templates.xml b/addons/l10n_es_edi_facturae/data/facturae_templates.xml index 86a12aaa1df..7e08a94c93d 100644 --- a/addons/l10n_es_edi_facturae/data/facturae_templates.xml +++ b/addons/l10n_es_edi_facturae/data/facturae_templates.xml @@ -5,18 +5,18 @@