From c260313c23618aecdfe72ba12ef14b1db4f4322b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 4 Feb 2026 10:03:48 +0100 Subject: [PATCH] Use the legal notice of tax as tax exemption reason in UBL invoice Closes #14572 --- modules/edocument_ubl/edocument.py | 6 ++++-- modules/edocument_ubl/template/2/base.xml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/edocument_ubl/edocument.py b/modules/edocument_ubl/edocument.py index 9f5cd29148..13718613f0 100644 --- a/modules/edocument_ubl/edocument.py +++ b/modules/edocument_ubl/edocument.py @@ -190,14 +190,16 @@ class Invoice(Model): 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 --git a/modules/edocument_ubl/template/2/base.xml b/modules/edocument_ubl/template/2/base.xml index bb14b39e8c..c94dceaf95 100644 --- a/modules/edocument_ubl/template/2/base.xml +++ b/modules/edocument_ubl/template/2/base.xml @@ -84,6 +84,7 @@ this repository contains the full copyright notices and license terms. --> ${tax.unece_category_code} ${format((tax.rate * 100).normalize(), 'f')} + ${tax.legal_notice} ${tax.unece_code}