details:   https://code.tryton.org/tryton/commit/007d7d62cf90
branch:    default
user:      Cédric Krier <[email protected]>
date:      Mon Dec 22 12:37:52 2025 +0100
description:
        Do not set country name in Peppol UBL

        UBL-CR-166: A UBL invoice should not include the 
AccountingSupplierParty Party
        PostalAddress Country Name
        UBL-CR-229: A UBL invoice should not include the 
AccountingCustomerParty Party
        PostalAddress Country Name
diffstat:

 modules/edocument_ubl/template/2/CreditNote.xml |  4 ++--
 modules/edocument_ubl/template/2/Invoice.xml    |  4 ++--
 modules/edocument_ubl/template/2/base.xml       |  8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diffs (71 lines):

diff -r 86cffcf12558 -r 007d7d62cf90 
modules/edocument_ubl/template/2/CreditNote.xml
--- a/modules/edocument_ubl/template/2/CreditNote.xml   Mon Dec 22 11:17:26 
2025 +0100
+++ b/modules/edocument_ubl/template/2/CreditNote.xml   Mon Dec 22 12:37:52 
2025 +0100
@@ -45,10 +45,10 @@
     </cac:Attachment>
 </cac:AdditionalDocumentReference>
 <cac:AccountingSupplierParty>
-    ${Party(this.accounting_supplier_party, this.accounting_supplier_address, 
this.accounting_supplier_tax_identifier)}
+    ${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)}
+    ${Party(this.accounting_customer_party, this.accounting_customer_address, 
this.accounting_customer_tax_identifier, 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 86cffcf12558 -r 007d7d62cf90 
modules/edocument_ubl/template/2/Invoice.xml
--- a/modules/edocument_ubl/template/2/Invoice.xml      Mon Dec 22 11:17:26 
2025 +0100
+++ b/modules/edocument_ubl/template/2/Invoice.xml      Mon Dec 22 12:37:52 
2025 +0100
@@ -45,10 +45,10 @@
     </cac:Attachment>
 </cac:AdditionalDocumentReference>
 <cac:AccountingSupplierParty>
-    ${Party(this.accounting_supplier_party, this.accounting_supplier_address, 
this.accounting_supplier_tax_identifier)}
+    ${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)}
+    ${Party(this.accounting_customer_party, this.accounting_customer_address, 
this.accounting_customer_tax_identifier, 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 86cffcf12558 -r 007d7d62cf90 modules/edocument_ubl/template/2/base.xml
--- a/modules/edocument_ubl/template/2/base.xml Mon Dec 22 11:17:26 2025 +0100
+++ b/modules/edocument_ubl/template/2/base.xml Mon Dec 22 12:37:52 2025 +0100
@@ -4,7 +4,7 @@
 <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)">
+    <py:def function="Party(party, address=None, tax_identifier=None, 
specification='')">
         <cac:Party>
             <py:with vars="identifier = party.identifier_eas">
                 <py:if test="identifier">
@@ -16,7 +16,7 @@
                     <cbc:ID py:attrs="{'schemeID': 
identifier.iso_6523}">${identifier.code}</cbc:ID>
                 </cac:PartyIdentification>
             </py:for>
-            <cac:PostalAddress 
py:if="address">${Address(address)}</cac:PostalAddress>
+            <cac:PostalAddress py:if="address">${Address(address, 
specification=specification)}</cac:PostalAddress>
             <cac:PartyTaxScheme py:if="tax_identifier and 
tax_identifier.unece_code">
                 <py:choose>
                     <py:when test="tax_identifier.vatin">
@@ -40,7 +40,7 @@
             </cac:PartyLegalEntity>
         </cac:Party>
     </py:def>
-    <py:def function="Address(address)">
+    <py:def function="Address(address, specification='')">
         <cbc:Postbox py:if="address.post_box">${address.post_box}</cbc:Postbox>
         <cbc:Floor 
py:if="address.floor_number">${address.floor_number}</cbc:Floor>
         <cbc:Room py:if="address.room_number">${address.room_number}</cbc:Room>
@@ -58,7 +58,7 @@
         </cac:AddressLine>
         <cac:Country py:if="address.country">
             
<cbc:IdentificationCode>${address.country.code}</cbc:IdentificationCode>
-            <cbc:Name>${address.country.name}</cbc:Name>
+            <cbc:Name py:if="not (specification or 
'').startswith('peppol')">${address.country.name}</cbc:Name>
         </cac:Country>
     </py:def>
 </py:strip>

Reply via email to