details:   https://code.tryton.org/tryton/commit/1974969ddafc
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Jan 23 11:05:13 2026 +0100
description:
        Do not group taxes by tax group in UBL invoice and credit note

        The Peppol UBL rules limit to a single TaxTotal.

        Closes #14542
diffstat:

 modules/edocument_ubl/edocument.py |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r 3aa894f69f0a -r 1974969ddafc modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py        Mon Jan 26 13:37:04 2026 +0100
+++ b/modules/edocument_ubl/edocument.py        Fri Jan 23 11:05:13 2026 +0100
@@ -22,7 +22,7 @@
 from trytond.modules.product import round_price
 from trytond.pool import Pool, PoolMeta
 from trytond.rpc import RPC
-from trytond.tools import cached_property, slugify
+from trytond.tools import cached_property, slugify, sortable_values
 from trytond.transaction import Transaction
 
 from .exceptions import InvoiceError
@@ -184,14 +184,17 @@
 
     @property
     def taxes(self):
-        def key(line):
-            return line.tax.group
-        for group, lines in groupby(
-                sorted(self.invoice.taxes, key=key), key=key):
+        for group, lines in groupby(sorted(
+                    self.invoice.taxes,
+                    key=sortable_values(self._taxes_key)),
+                key=self._taxes_key):
             lines = list(lines)
             amount = sum(l.amount for l in lines)
             yield group, lines, amount
 
+    def _taxes_key(self, line):
+        return ()
+
     @cached_property
     def lines(self):
         return [l for l in self.invoice.lines if l.type == 'line']

Reply via email to