details:   https://code.tryton.org/tryton/commit/f0e4a973d246
branch:    default
user:      Cédric Krier <[email protected]>
date:      Mon Jan 19 11:34:14 2026 +0100
description:
        Create the party name using the registration name of the legal entity 
from UBL first

        Closes #14514
diffstat:

 modules/edocument_ubl/edocument.py                               |  4 +++-
 modules/edocument_ubl/tests/scenario_ubl_2_credit_note_parse.rst |  4 ++--
 modules/edocument_ubl/tests/scenario_ubl_2_invoice_parse.rst     |  4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r 99b258e3f056 -r f0e4a973d246 modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py        Fri Jan 23 12:12:27 2026 +0100
+++ b/modules/edocument_ubl/edocument.py        Mon Jan 19 11:34:14 2026 +0100
@@ -644,7 +644,9 @@
         pool = Pool()
         Party = pool.get('party.party')
         party = Party()
-        party.name = party_el.findtext('./{*}PartyName/{*}Name')
+        party.name = (
+            party_el.findtext('./{*}PartyLegalEntity/{*}RegistrationName')
+            or party_el.findtext('./{*}PartyName/{*}Name'))
         identifiers = []
         for identifier in party_el.iterfind('./{*}PartyIdentification/{*}ID'):
             if identifier.text:
diff -r 99b258e3f056 -r f0e4a973d246 
modules/edocument_ubl/tests/scenario_ubl_2_credit_note_parse.rst
--- a/modules/edocument_ubl/tests/scenario_ubl_2_credit_note_parse.rst  Fri Jan 
23 12:12:27 2026 +0100
+++ b/modules/edocument_ubl/tests/scenario_ubl_2_credit_note_parse.rst  Mon Jan 
19 11:34:14 2026 +0100
@@ -70,9 +70,9 @@
     'TOSL108'
     >>> assertEqual(invoice.invoice_date, dt.date(2009, 12, 15))
     >>> invoice.party.name
-    'Salescompany ltd.'
+    'The Sellercompany Incorporated'
     >>> invoice.invoice_address.rec_name
-    'Salescompany ltd., Main street 1 5467, 54321, Big city'
+    'The Sellercompany Incorporated, Main street 1 5467, 54321, Big city'
     >>> assertEqual(invoice.company, company)
     >>> assertEqual(
     ...     invoice.total_amount,
diff -r 99b258e3f056 -r f0e4a973d246 
modules/edocument_ubl/tests/scenario_ubl_2_invoice_parse.rst
--- a/modules/edocument_ubl/tests/scenario_ubl_2_invoice_parse.rst      Fri Jan 
23 12:12:27 2026 +0100
+++ b/modules/edocument_ubl/tests/scenario_ubl_2_invoice_parse.rst      Mon Jan 
19 11:34:14 2026 +0100
@@ -70,9 +70,9 @@
     'TOSL108'
     >>> assertEqual(invoice.invoice_date, dt.date(2009, 12, 15))
     >>> invoice.party.name
-    'Salescompany ltd.'
+    'The Sellercompany Incorporated'
     >>> invoice.invoice_address.rec_name
-    'Salescompany ltd., Main street 1 5467, 54321, Big city'
+    'The Sellercompany Incorporated, Main street 1 5467, 54321, Big city'
     >>> assertEqual(invoice.company, company)
     >>> assertEqual(
     ...     invoice.total_amount,

Reply via email to