details:   https://code.tryton.org/tryton/commit/3ad051b83ba7
branch:    default
user:      Cédric Krier <[email protected]>
date:      Wed Feb 04 10:03:48 2026 +0100
description:
        Use the legal notice of tax as tax exemption reason in UBL invoice

        Closes #14572
diffstat:

 modules/edocument_ubl/edocument.py        |  6 ++++--
 modules/edocument_ubl/template/2/base.xml |  1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r e6e5d9c22571 -r 3ad051b83ba7 modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py        Thu Jan 15 10:35:05 2026 +0100
+++ b/modules/edocument_ubl/edocument.py        Wed Feb 04 10:03:48 2026 +0100
@@ -190,14 +190,16 @@
     def taxes(self):
         class Tax(namedtuple(
                     'Tax',
-                    ('type', 'rate', 'unece_category_code', 'unece_code'))):
+                    ('type', 'rate', 'unece_category_code', 'unece_code',
+                        'legal_notice'))):
             @classmethod
             def from_line(cls, line):
                 return Tax(
                     type=line.tax.type,
                     rate=line.tax.rate,
                     unece_category_code=line.tax.unece_category_code,
-                    unece_code=line.tax.unece_code)
+                    unece_code=line.tax.unece_code,
+                    legal_notice=line.legal_notice or '')
         TaxLine = namedtuple('TaxLine', ('base', 'amount', 'tax'))
         for group, lines in groupby(sorted(
                     self.invoice.taxes,
diff -r e6e5d9c22571 -r 3ad051b83ba7 modules/edocument_ubl/template/2/base.xml
--- a/modules/edocument_ubl/template/2/base.xml Thu Jan 15 10:35:05 2026 +0100
+++ b/modules/edocument_ubl/template/2/base.xml Wed Feb 04 10:03:48 2026 +0100
@@ -84,6 +84,7 @@
     <py:def function="TaxCategory(tax)">
         <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>
+        <cbc:TaxExemptionReason 
py:if="tax.legal_notice">${tax.legal_notice}</cbc:TaxExemptionReason>
         <cac:TaxScheme py:if="tax.unece_code">
             <cbc:ID>${tax.unece_code}</cbc:ID>
         </cac:TaxScheme>

Reply via email to