details: https://code.tryton.org/tryton/commit/31d4f2075485
branch: default
user: Maxime Richez <[email protected]>
date: Mon Dec 22 18:34:35 2025 +0100
description:
Set only one customer identification in UBL Invoice and CreditNote
UBL-SR-16: Buyer identifier shall occur maximum once
Closes #14443
diffstat:
modules/edocument_ubl/template/2/CreditNote.xml | 2 +-
modules/edocument_ubl/template/2/Invoice.xml | 2 +-
modules/edocument_ubl/template/2/base.xml | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diffs (46 lines):
diff -r 5cbe0e76d6e5 -r 31d4f2075485
modules/edocument_ubl/template/2/CreditNote.xml
--- a/modules/edocument_ubl/template/2/CreditNote.xml Mon Dec 22 12:37:22
2025 +0100
+++ b/modules/edocument_ubl/template/2/CreditNote.xml Mon Dec 22 18:34:35
2025 +0100
@@ -48,7 +48,7 @@
${Party(this.accounting_supplier_party, this.accounting_supplier_address,
this.accounting_supplier_tax_identifier, specification=specification)}
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
- ${Party(this.accounting_customer_party, this.accounting_customer_address,
this.accounting_customer_tax_identifier, specification=specification)}
+ ${Party(this.accounting_customer_party, this.accounting_customer_address,
this.accounting_customer_tax_identifier,
identifications=[this.accounting_customer_party.identifier_iso6523] if
(specification or '').startswith('peppol') else None,
specification=specification)}
</cac:AccountingCustomerParty>
<cac:PaymentTerms py:for="line in this.invoice.lines_to_pay">
<cbc:Note py:if="this.invoice.payment_term and
this.invoice.payment_term.description">${this.invoice.payment_term.description}</cbc:Note>
diff -r 5cbe0e76d6e5 -r 31d4f2075485
modules/edocument_ubl/template/2/Invoice.xml
--- a/modules/edocument_ubl/template/2/Invoice.xml Mon Dec 22 12:37:22
2025 +0100
+++ b/modules/edocument_ubl/template/2/Invoice.xml Mon Dec 22 18:34:35
2025 +0100
@@ -48,7 +48,7 @@
${Party(this.accounting_supplier_party, this.accounting_supplier_address,
this.accounting_supplier_tax_identifier, specification=specification)}
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
- ${Party(this.accounting_customer_party, this.accounting_customer_address,
this.accounting_customer_tax_identifier, specification=specification)}
+ ${Party(this.accounting_customer_party, this.accounting_customer_address,
this.accounting_customer_tax_identifier,
identifications=[this.accounting_customer_party.identifier_iso6523] if
(specification or '').startswith('peppol') else None,
specification=specification)}
</cac:AccountingCustomerParty>
<cac:PaymentTerms py:for="line in this.invoice.lines_to_pay">
<cbc:Note py:if="this.invoice.payment_term and
this.invoice.payment_term.description">${this.invoice.payment_term.description}</cbc:Note>
diff -r 5cbe0e76d6e5 -r 31d4f2075485 modules/edocument_ubl/template/2/base.xml
--- a/modules/edocument_ubl/template/2/base.xml Mon Dec 22 12:37:22 2025 +0100
+++ b/modules/edocument_ubl/template/2/base.xml Mon Dec 22 18:34:35 2025 +0100
@@ -4,15 +4,15 @@
<py:strip xmlns:py="http://genshi.edgewall.org/"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
- <py:def function="Party(party, address=None, tax_identifier=None,
specification='')">
+ <py:def function="Party(party, address=None, tax_identifier=None,
identifications=None, specification='')">
<cac:Party>
<py:with vars="identifier = party.identifier_eas">
<py:if test="identifier">
<cbc:EndpointID py:attrs="{'schemeID':
identifier.eas_code}">${identifier.eas}</cbc:EndpointID>
</py:if>
</py:with>
- <py:for each="identifier in party.identifiers">
- <cac:PartyIdentification py:if="identifier.iso_6523">
+ <py:for each="identifier in identifications or party.identifiers">
+ <cac:PartyIdentification py:if="identifier and
identifier.iso_6523">
<cbc:ID py:attrs="{'schemeID':
identifier.iso_6523}">${identifier.code}</cbc:ID>
</cac:PartyIdentification>
</py:for>