details:   https://code.tryton.org/tryton/commit/c3adbccb09bb
branch:    7.8
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
        (grafted from f0e4a973d246c31027f6fcf7dc0c91bd57d377ad)
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 a479209485e6 -r c3adbccb09bb modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py        Mon Jan 19 11:48:55 2026 +0100
+++ b/modules/edocument_ubl/edocument.py        Mon Jan 19 11:34:14 2026 +0100
@@ -648,7 +648,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 = []
         identifiers_done = set()
         for identifier in chain(
diff -r a479209485e6 -r c3adbccb09bb 
modules/edocument_ubl/tests/scenario_ubl_2_credit_note_parse.rst
--- a/modules/edocument_ubl/tests/scenario_ubl_2_credit_note_parse.rst  Mon Jan 
19 11:48:55 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 a479209485e6 -r c3adbccb09bb 
modules/edocument_ubl/tests/scenario_ubl_2_invoice_parse.rst
--- a/modules/edocument_ubl/tests/scenario_ubl_2_invoice_parse.rst      Mon Jan 
19 11:48:55 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