From 36ca12e359eb9bc60ffe701723d4b9c5c4a7108c Mon Sep 17 00:00:00 2001 From: Julien Van Roy Date: Wed, 20 Sep 2023 08:02:23 +0000 Subject: [PATCH] [FIX] account: add _run_vat_test in account to avoid base_vat dependency This way, it can be used without having to add the dependency to `base_vat`. For instance, in `account_edi_ubl_cii` in `_import_retrieve_and_fill_partner`. This commit essentially backports part of commit 212be2920affdab5baf14b3025ef31ee2d6a652b closes odoo/odoo#136950 X-original-commit: 32e72ef26f033cf7701d7d797738688a339d9b77 Signed-off-by: Laurent Smet (las) Signed-off-by: Julien Van Roy (juvr) --- addons/account_edi_ubl_cii/__manifest__.py | 2 +- .../account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account_edi_ubl_cii/__manifest__.py b/addons/account_edi_ubl_cii/__manifest__.py index 5c85e29ae2d..39567544a8f 100644 --- a/addons/account_edi_ubl_cii/__manifest__.py +++ b/addons/account_edi_ubl_cii/__manifest__.py @@ -22,7 +22,7 @@ Note also that in order for Chorus Pro to automatically detect the "PDF/A-3 (Fac the "Factur-X PDF/A-3" option on the journal. This option will also validate the xml against the Factur-X and Chorus Pro rules and show the errors. """, - 'depends': ['account', 'base_vat'], + 'depends': ['account'], 'data': [ 'data/cii_22_templates.xml', 'data/ubl_20_templates.xml', diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py b/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py index 0774721deb8..711c53e1bdc 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py +++ b/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py @@ -259,7 +259,8 @@ class AccountEdiXmlCII(models.AbstractModel): mail = _find_value(f"//ram:{role}//ram:URIID[@schemeID='SMTP']") vat = _find_value(f"//ram:{role}/ram:SpecifiedTaxRegistration/ram:ID") phone = _find_value(f"//ram:{role}/ram:DefinedTradeContact/ram:TelephoneUniversalCommunication/ram:CompleteNumber") - self._import_retrieve_and_fill_partner(invoice, name=name, phone=phone, mail=mail, vat=vat) + country_code = _find_value(f'//ram:{role}/ram:PostalTradeAddress//ram:CountryID') + self._import_retrieve_and_fill_partner(invoice, name=name, phone=phone, mail=mail, vat=vat, country_code=country_code) # ==== currency_id ====