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,