odoo/odoo#282904

Created by fw-bot
Merged at 660419f75e8307c6e4a463b5c0b5640246f93c95

Statuses:

label
odoo-dev:saas-19.3-17.0-opw-6407399-account_edi_ubl_cii_category_code-esand-557606-fw
head
e43edf88298832af12ddb6649e7922481437beac
merged
2 days ago by Ester Andreetto (esand)
odoo/odoo
17.0 #281245
18.0 #282189
saas-18.3 #282441
saas-18.4 #282497
19.0 #282718
saas-19.1 #282767
saas-19.2 #282874
saas-19.3 #282904
saas-19.4 #283027
master #283241 ready

[FIX] account_edi_ubl_cii: correct logic for CountryCode tag

Issue before this commit:

When generating an electronic invoice (e.g., ZUGFeRD/Factur-X) with a 0% tax from a non-EEA supplier (e.g., Switzerland) to an EEA customer (e.g., Germany), the XML tax <ram:CategoryCode> is incorrectly set to 'E' (Exempt) instead of 'G' (Export).

Steps to reproduce the issue:

  1. Download Accounting and l10n_ch
  2. Set the VAT for the CH company
  3. Create an invoice for a German customer with 0% tax setted (for which you have to set as electronic invoicing the ZUGFeRD template into the Accounting tab of his contact)
  4. Send it and see that the tag <ram:CategoryCode> is setted as E instead of G

Cause of the issue:

The logic assigning the 'G' and 'K' tax category codes was only triggered if the supplier was located within the EEA. If the supplier was outside the EEA, the code bypassed this block entirely and fell back to the default 'E' code for 0% taxes.

Reason to introduce the fix:

Update the condition to trigger when either the supplier or the customer is in the EEA. This ensures that cross-border transactions involving at least one EEA party correctly evaluate and apply the 'G' (Export outside the EU) category code. Also the case supplier not in eea with VAT filled in + customer in eea + RC tax with amount != 0 is fixed now (letter G reported instead of S).

Documentation:

eInvoicing technical guidance document_v1.pdf

opw-6407399


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #282497
Forward-Port-Of: #281245