Skip to content

[FIX] account_edi_ubl_cii: correct logic for CountryCode tag - #282904

Closed
fw-bot wants to merge 1 commit into
odoo:saas-19.3from
odoo-dev:saas-19.3-17.0-opw-6407399-account_edi_ubl_cii_category_code-esand-557606-fw
Closed

[FIX] account_edi_ubl_cii: correct logic for CountryCode tag#282904
fw-bot wants to merge 1 commit into
odoo:saas-19.3from
odoo-dev:saas-19.3-17.0-opw-6407399-account_edi_ubl_cii_category_code-esand-557606-fw

Conversation

@fw-bot

@fw-bot fw-bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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

@robodoo

robodoo commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@robodoo robodoo added conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot labels Aug 18, 2026
@fw-bot

fw-bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@eesteerina @Megaaaaaa cherrypicking of pull request #281245 failed.

stdout:

Auto-merging addons/account_edi_ubl_cii/models/account_edi_common.py
CONFLICT (content): Merge conflict in addons/account_edi_ubl_cii/models/account_edi_common.py
Auto-merging addons/account_edi_ubl_cii/tests/test_ubl_cii.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

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).

opw-6407399

X-original-commit: 64643fe
@eesteerina
eesteerina force-pushed the saas-19.3-17.0-opw-6407399-account_edi_ubl_cii_category_code-esand-557606-fw branch from 3bbcade to e43edf8 Compare August 18, 2026 11:15
@eesteerina

Copy link
Copy Markdown
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Aug 18, 2026
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).

opw-6407399

closes #282904

X-original-commit: 64643fe
Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
Signed-off-by: Ester Andreetto (esand) <esand@odoo.com>
@robodoo robodoo closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants