details: https://code.tryton.org/tryton/commit/ade39f93e1f7
branch: default
user: Cédric Krier <[email protected]>
date: Mon Feb 16 13:31:03 2026 +0100
description:
Update template to use invoice taxes of lines as invoice tax
Closes #14609
diffstat:
modules/edocument_ubl/template/2/CreditNote.xml | 8 ++++----
modules/edocument_ubl/template/2/Invoice.xml | 8 ++++----
modules/edocument_ubl/tests/test_module.py | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diffs (69 lines):
diff -r 5c2f445c099e -r ade39f93e1f7
modules/edocument_ubl/template/2/CreditNote.xml
--- a/modules/edocument_ubl/template/2/CreditNote.xml Wed Feb 25 09:04:03
2026 +0100
+++ b/modules/edocument_ubl/template/2/CreditNote.xml Mon Feb 16 13:31:03
2026 +0100
@@ -78,8 +78,8 @@
</py:with>
<cbc:AllowanceChargeReason>${allowance_charge.product.name}</cbc:AllowanceChargeReason>
<cbc:Amount py:attrs="{'currencyID':
this.invoice.currency.code}">${abs(allowance_charge.amount)}</cbc:Amount>
- <cac:TaxCategory py:for="tax in allowance_charge.invoice_taxes">
- ${TaxCategory(tax)}
+ <cac:TaxCategory py:for="tax_line in allowance_charge.invoice_taxes">
+ ${TaxCategory(tax_line.tax)}
</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:TaxTotal py:for="group, lines, amount in this.taxes">
@@ -122,8 +122,8 @@
</cac:StandardItemIdentification>
</py:with>
</py:if>
- <cac:ClassifiedTaxCategory py:for="tax in line.invoice_taxes">
- ${TaxCategory(tax)}
+ <cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
+ ${TaxCategory(tax_line.tax)}
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
diff -r 5c2f445c099e -r ade39f93e1f7
modules/edocument_ubl/template/2/Invoice.xml
--- a/modules/edocument_ubl/template/2/Invoice.xml Wed Feb 25 09:04:03
2026 +0100
+++ b/modules/edocument_ubl/template/2/Invoice.xml Mon Feb 16 13:31:03
2026 +0100
@@ -78,8 +78,8 @@
</py:with>
<cbc:AllowanceChargeReason>${allowance_charge.product.name}</cbc:AllowanceChargeReason>
<cbc:Amount py:attrs="{'currencyID':
this.invoice.currency.code}">${abs(allowance_charge.amount)}</cbc:Amount>
- <cac:TaxCategory py:for="tax in allowance_charge.invoice_taxes">
- ${TaxCategory(tax)}
+ <cac:TaxCategory py:for="tax_line in allowance_charge.invoice_taxes">
+ ${TaxCategory(tax_line.tax)}
</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:TaxTotal py:for="group, lines, amount in this.taxes">
@@ -122,8 +122,8 @@
</cac:StandardItemIdentification>
</py:with>
</py:if>
- <cac:ClassifiedTaxCategory py:for="tax in line.invoice_taxes">
- ${TaxCategory(tax)}
+ <cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
+ ${TaxCategory(tax_line.tax)}
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
diff -r 5c2f445c099e -r ade39f93e1f7 modules/edocument_ubl/tests/test_module.py
--- a/modules/edocument_ubl/tests/test_module.py Wed Feb 25 09:04:03
2026 +0100
+++ b/modules/edocument_ubl/tests/test_module.py Mon Feb 16 13:31:03
2026 +0100
@@ -104,13 +104,13 @@
unit_price=Decimal('100.0000'),
amount=Decimal('100.00'),
description="Description",
- invoice_taxes=[t.tax for t in taxes],
+ invoice_taxes=taxes,
), Mock(spec=Invoice,
type='line',
product=charge,
quantity=1,
amount=Decimal('5.00'),
- invoice_taxes=[t.tax for t in taxes],
+ invoice_taxes=taxes,
)]
invoice = MagicMock(spec=Invoice,
id=-1,