From 2b7c3f9f89e5de646b71c92f44acb5db10b68671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 16 Feb 2026 13:31:03 +0100 Subject: [PATCH] Update template to use invoice taxes of lines as invoice tax Closes #14609 --- 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(-) diff --git a/modules/edocument_ubl/template/2/CreditNote.xml b/modules/edocument_ubl/template/2/CreditNote.xml index a5fc9f1df0..62b0261ed6 100644 --- a/modules/edocument_ubl/template/2/CreditNote.xml +++ b/modules/edocument_ubl/template/2/CreditNote.xml @@ -78,8 +78,8 @@ this repository contains the full copyright notices and license terms. --> ${allowance_charge.product.name} ${abs(allowance_charge.amount)} - - ${TaxCategory(tax)} + + ${TaxCategory(tax_line.tax)} @@ -122,8 +122,8 @@ this repository contains the full copyright notices and license terms. --> - - ${TaxCategory(tax)} + + ${TaxCategory(tax_line.tax)} diff --git a/modules/edocument_ubl/template/2/Invoice.xml b/modules/edocument_ubl/template/2/Invoice.xml index 251594e190..9c713588c9 100644 --- a/modules/edocument_ubl/template/2/Invoice.xml +++ b/modules/edocument_ubl/template/2/Invoice.xml @@ -78,8 +78,8 @@ this repository contains the full copyright notices and license terms. --> ${allowance_charge.product.name} ${abs(allowance_charge.amount)} - - ${TaxCategory(tax)} + + ${TaxCategory(tax_line.tax)} @@ -122,8 +122,8 @@ this repository contains the full copyright notices and license terms. --> - - ${TaxCategory(tax)} + + ${TaxCategory(tax_line.tax)} diff --git a/modules/edocument_ubl/tests/test_module.py b/modules/edocument_ubl/tests/test_module.py index 85a7e9ddd5..9ac298e92e 100644 --- a/modules/edocument_ubl/tests/test_module.py +++ b/modules/edocument_ubl/tests/test_module.py @@ -104,13 +104,13 @@ def get_invoice(): 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,