From 14479dbccfeb54df490fd6c1d243a8befebcd74b Mon Sep 17 00:00:00 2001 From: Julien Van Roy Date: Thu, 21 Mar 2024 11:27:57 +0100 Subject: [PATCH] [FIX] account_edi_ubl_cii: tax category for supplier without VAT Bug: When an irish company without VAT invoices a Norvegian company with a 0% tax, the category of the tax is "K" in the Bis 3 xml, which will raise: "[BR-IC-02]-An Invoice that contains an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is "Intra-community supply" shall contain the Seller VAT Identifier (BT-31) or the Seller tax representative VAT identifier (BT-63) and the Buyer VAT identifier (BT-48)." Using code "G" would also raise: "[BR-G-02]-An Invoice that contains an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is "Export outside the EU" shall contain the Seller VAT Identifier (BT-31) or the Seller tax representative VAT identifier (BT-63)." Fix: We should only use "G" or "K" when the supplier has a VAT. If a supplier without a VAT invoices with a 0% tax, we should use the tax category "E" (Exempted). opw-3785810 closes odoo/odoo#158670 X-original-commit: 357f1aec4bfa12fe476a207f2acfc1bf4a6232d5 Signed-off-by: Laurent Smet (las) Signed-off-by: Julien Van Roy (juvr) --- addons/account_edi_ubl_cii/models/account_edi_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4760963c15c..b5352db4ee7 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_common.py +++ b/addons/account_edi_ubl_cii/models/account_edi_common.py @@ -177,7 +177,7 @@ class AccountEdiCommon(models.AbstractModel): else: return create_dict(tax_category_code='S') # standard VAT - if supplier.country_id.code in european_economic_area: + if supplier.country_id.code in european_economic_area and supplier.vat: if tax.amount != 0: # otherwise, the validator will complain because G and K code should be used with 0% tax return create_dict(tax_category_code='S')