From f1120ca25441987cb44febf66f0ccac95ee69e11 Mon Sep 17 00:00:00 2001 From: Julien Van Roy Date: Sat, 8 Oct 2022 15:29:44 +0000 Subject: [PATCH] [FIX] account_edi_ubl_cii: fix import facturx Factur-x import is broken since: 4ea13aea05b1d9650a2c9605d24ac7d69583cefa Indeed, for non FR/DE companies, the `_get_xml_builder` is now returning None, thus the import `_create_invoice_from_xml_tree` and `_update_invoice_from_xml_tree` do not work. closes odoo/odoo#102777 X-original-commit: 6eb6662b53a521adda0588d05f316652b66e758b Signed-off-by: Laurent Smet Signed-off-by: Julien Van Roy --- addons/account_edi_ubl_cii/models/account_edi_format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_edi_ubl_cii/models/account_edi_format.py b/addons/account_edi_ubl_cii/models/account_edi_format.py index d3f0acf219f..5bb2565a918 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_format.py +++ b/addons/account_edi_ubl_cii/models/account_edi_format.py @@ -180,7 +180,7 @@ class AccountEdiFormat(models.Model): ('company_id', '=', self.env.company.id), ('type', '=', 'purchase') ], limit=1) - if not self._is_ubl_cii_available(journal.company_id): + if not self._is_ubl_cii_available(journal.company_id) and self.code != 'facturx_1_0_05': return super()._create_invoice_from_xml_tree(filename, tree, journal=journal) # infer the xml builder @@ -197,7 +197,7 @@ class AccountEdiFormat(models.Model): # EXTENDS account_edi self.ensure_one() - if not self._is_ubl_cii_available(invoice.company_id): + if not self._is_ubl_cii_available(invoice.company_id) and self.code != 'facturx_1_0_05': return super()._update_invoice_from_xml_tree(filename, tree, invoice) # infer the xml builder