details: https://code.tryton.org/tryton/commit/8fe46a0f9740
branch: 7.8
user: Cédric Krier <[email protected]>
date: Mon Feb 16 13:31:11 2026 +0100
description:
Update template to use invoice taxes of lines as invoice tax
Closes #14609
diffstat:
modules/edocument_ubl/template/2/CreditNote.xml | 10 +++++-----
modules/edocument_ubl/template/2/Invoice.xml | 10 +++++-----
modules/edocument_ubl/tests/test_module.py | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
diffs (52 lines):
diff -r a13348dad6d7 -r 8fe46a0f9740
modules/edocument_ubl/template/2/CreditNote.xml
--- a/modules/edocument_ubl/template/2/CreditNote.xml Wed Feb 18 19:16:29
2026 +0100
+++ b/modules/edocument_ubl/template/2/CreditNote.xml Mon Feb 16 13:31:11
2026 +0100
@@ -106,11 +106,11 @@
</cac:StandardItemIdentification>
</py:with>
</py:if>
- <cac:ClassifiedTaxCategory py:for="tax in line.invoice_taxes">
- <cbc:ID
py:if="tax.unece_category_code">${tax.unece_category_code}</cbc:ID>
- <cbc:Percent py:if="tax.type == 'percentage'">${format((tax.rate *
100).normalize(), 'f')}</cbc:Percent>
- <cac:TaxScheme py:if="tax.unece_code">
- <cbc:ID>${tax.unece_code}</cbc:ID>
+ <cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
+ <cbc:ID
py:if="tax_line.tax.unece_category_code">${tax_line.tax.unece_category_code}</cbc:ID>
+ <cbc:Percent py:if="tax_line.tax.type ==
'percentage'">${format((tax_line.tax.rate * 100).normalize(),
'f')}</cbc:Percent>
+ <cac:TaxScheme py:if="tax_line.tax.unece_code">
+ <cbc:ID>${tax_line.tax.unece_code}</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
diff -r a13348dad6d7 -r 8fe46a0f9740
modules/edocument_ubl/template/2/Invoice.xml
--- a/modules/edocument_ubl/template/2/Invoice.xml Wed Feb 18 19:16:29
2026 +0100
+++ b/modules/edocument_ubl/template/2/Invoice.xml Mon Feb 16 13:31:11
2026 +0100
@@ -106,11 +106,11 @@
</cac:StandardItemIdentification>
</py:with>
</py:if>
- <cac:ClassifiedTaxCategory py:for="tax in line.invoice_taxes">
- <cbc:ID
py:if="tax.unece_category_code">${tax.unece_category_code}</cbc:ID>
- <cbc:Percent py:if="tax.type == 'percentage'">${format((tax.rate *
100).normalize(), 'f')}</cbc:Percent>
- <cac:TaxScheme py:if="tax.unece_code">
- <cbc:ID>${tax.unece_code}</cbc:ID>
+ <cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
+ <cbc:ID
py:if="tax_line.tax.unece_category_code">${tax_line.tax.unece_category_code}</cbc:ID>
+ <cbc:Percent py:if="tax_line.tax.type ==
'percentage'">${format((tax_line.tax.rate * 100).normalize(),
'f')}</cbc:Percent>
+ <cac:TaxScheme py:if="tax_line.tax.unece_code">
+ <cbc:ID>${tax_line.tax.unece_code}</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
diff -r a13348dad6d7 -r 8fe46a0f9740 modules/edocument_ubl/tests/test_module.py
--- a/modules/edocument_ubl/tests/test_module.py Wed Feb 18 19:16:29
2026 +0100
+++ b/modules/edocument_ubl/tests/test_module.py Mon Feb 16 13:31:11
2026 +0100
@@ -98,7 +98,7 @@
unit_price=Decimal('100.0000'),
amount=Decimal('100.00'),
description="Description",
- invoice_taxes=[t.tax for t in taxes],
+ invoice_taxes=taxes,
)]
invoice = MagicMock(spec=Invoice,
id=-1,