odoo/odoo#282904
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: (runtime 1394s)
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 1s)
- ci/documentation: (runtime 1297s)
- ci/design-theme: (runtime 1s)
- 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:
- Download Accounting and l10n_ch
- Set the VAT for the CH company
- 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)
- 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
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr