details:   https://code.tryton.org/tryton/commit/4ee50ddc421e
branch:    default
user:      Cédric Krier <[email protected]>
date:      Tue Jan 06 17:42:51 2026 +0100
description:
        Fill buyer's item identification in UBL invoice

        Closes #14470
diffstat:

 modules/edocument_ubl/CHANGELOG                 |   1 +
 modules/edocument_ubl/template/2/CreditNote.xml |  11 +++++++----
 modules/edocument_ubl/template/2/Invoice.xml    |  11 +++++++----
 3 files changed, 15 insertions(+), 8 deletions(-)

diffs (52 lines):

diff -r 4a431db124b4 -r 4ee50ddc421e modules/edocument_ubl/CHANGELOG
--- a/modules/edocument_ubl/CHANGELOG   Tue Jan 06 17:41:05 2026 +0100
+++ b/modules/edocument_ubl/CHANGELOG   Tue Jan 06 17:42:51 2026 +0100
@@ -1,3 +1,4 @@
+* Fill buyer's item identification
 
 Version 7.8.0 - 2025-12-15
 --------------------------
diff -r 4a431db124b4 -r 4ee50ddc421e 
modules/edocument_ubl/template/2/CreditNote.xml
--- a/modules/edocument_ubl/template/2/CreditNote.xml   Tue Jan 06 17:41:05 
2026 +0100
+++ b/modules/edocument_ubl/template/2/CreditNote.xml   Tue Jan 06 17:42:51 
2026 +0100
@@ -95,11 +95,14 @@
     <cbc:LineExtensionAmount py:attrs="{'currencyID': 
this.invoice.currency.code}">${-line.amount}</cbc:LineExtensionAmount>
     <cac:Item>
         <cbc:Description 
py:if="line.description">${line.description}</cbc:Description>
-        <cbc:Name>${line.product_name or line.summary}</cbc:Name>
+        <cbc:Name>${line.product.name if line.product else 
line.summary}</cbc:Name>
+        <cac:BuyersItemIdentification py:if="line.product_customer_code">
+            <cbc:ID>${line.product_customer_code}</cbc:ID>
+        </cac:BuyersItemIdentification>
+        <cac:SellersItemIdentification py:if="line.product_supplier_code">
+            <cbc:ID>${line.product_supplier_code}</cbc:ID>
+        </cac:SellersItemIdentification>
         <py:if test="line.product">
-            <cac:SellersItemIdentification py:if="line.product.code">
-                <cbc:ID>${line.product.code}</cbc:ID>
-            </cac:SellersItemIdentification>
             <py:with vars="gtin=line.product.identifier_get(['ean', 'isbn', 
'ismn'])">
                 <cac:StandardItemIdentification py:if="gtin">
                     <cbc:ID schemeID="0160">${gtin}</cbc:ID>
diff -r 4a431db124b4 -r 4ee50ddc421e 
modules/edocument_ubl/template/2/Invoice.xml
--- a/modules/edocument_ubl/template/2/Invoice.xml      Tue Jan 06 17:41:05 
2026 +0100
+++ b/modules/edocument_ubl/template/2/Invoice.xml      Tue Jan 06 17:42:51 
2026 +0100
@@ -95,11 +95,14 @@
     <cbc:LineExtensionAmount py:attrs="{'currencyID': 
this.invoice.currency.code}">${line.amount}</cbc:LineExtensionAmount>
     <cac:Item>
         <cbc:Description 
py:if="line.description">${line.description}</cbc:Description>
-        <cbc:Name>${line.product_name or line.summary}</cbc:Name>
+        <cbc:Name>${line.product.name if line.product else 
line.summary}</cbc:Name>
+        <cac:BuyersItemIdentification py:if="line.product_customer_code">
+            <cbc:ID>${line.product_customer_code}</cbc:ID>
+        </cac:BuyersItemIdentification>
+        <cac:SellersItemIdentification py:if="line.product_supplier_code">
+            <cbc:ID>${line.product_supplier_code}</cbc:ID>
+        </cac:SellersItemIdentification>
         <py:if test="line.product">
-            <cac:SellersItemIdentification py:if="line.product.code">
-                <cbc:ID>${line.product.code}</cbc:ID>
-            </cac:SellersItemIdentification>
             <py:with vars="gtin=line.product.identifier_get(['ean', 'isbn', 
'ismn'])">
                 <cac:StandardItemIdentification py:if="gtin">
                     <cbc:ID schemeID="0160">${gtin}</cbc:ID>

Reply via email to