diff --git a/addons/account_edi_ubl_cii/models/account_edi_common.py b/addons/account_edi_ubl_cii/models/account_edi_common.py index ce830396e3e..7f55f40559c 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_common.py +++ b/addons/account_edi_ubl_cii/models/account_edi_common.py @@ -503,7 +503,7 @@ class AccountEdiCommon(models.AbstractModel): # quantity invoice_line_form.quantity = billed_qty * qty_factor - if product_uom_id is not None: + if product_uom_id is not None and not invoice_line_form._get_modifier('product_uom_id', 'invisible'): invoice_line_form.product_uom_id = product_uom_id # price_unit 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 6b0b63ce445..c1217c279a6 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 @@ -225,7 +225,7 @@ class AccountEdiXmlCII(models.AbstractModel): # ==== currency_id ==== currency_code_node = tree.find('.//{*}InvoiceCurrencyCode') - if currency_code_node is not None: + if currency_code_node is not None and self.env.user.has_group('base.group_multi_currency'): currency = self.env['res.currency'].with_context(active_test=False).search([ ('name', '=', currency_code_node.text), ], limit=1) diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py index 913249524e0..a469d4be491 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py +++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py @@ -476,7 +476,7 @@ class AccountEdiXmlUBL20(models.AbstractModel): # ==== currency_id ==== currency_code_node = tree.find('.//{*}DocumentCurrencyCode') - if currency_code_node is not None: + if currency_code_node is not None and self.env.user.has_group('base.group_multi_currency'): currency = self.env['res.currency'].with_context(active_test=False).search([ ('name', '=', currency_code_node.text), ], limit=1) diff --git a/addons/l10n_it_edi/models/account_edi_format.py b/addons/l10n_it_edi/models/account_edi_format.py index 6eb45e700a1..2042fb8a6bb 100644 --- a/addons/l10n_it_edi/models/account_edi_format.py +++ b/addons/l10n_it_edi/models/account_edi_format.py @@ -471,7 +471,7 @@ class AccountEdiFormat(models.Model): # Currency. <2.1.1.2> elements = body_tree.xpath('.//DatiGeneraliDocumento/Divisa') - if elements: + if elements and self.env.user.has_group('base.group_multi_currency'): currency_str = elements[0].text currency = self.env.ref('base.%s' % currency_str.upper(), raise_if_not_found=False) if currency != self.env.company.currency_id and currency.active: