From f11bb1bd42c9ddb4fbc7f05d64c62591638d6322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 27 Apr 2025 17:28:49 +0200 Subject: [PATCH] Update UN/CEFACT CrossIndustryInvoice template to use structured address Use unstructured street for Line and fill StreetName and BuildingNumber with structured values. --- .../template/16B-CII/CrossIndustryInvoice.xml | 6 ++++-- modules/edocument_uncefact/tests/test_module.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml index 8e009ba9c7..5ca38b5433 100644 --- a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml +++ b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml @@ -25,19 +25,21 @@ this repository contains the full copyright notices and license terms. --> ${address.postal_code} - ${address.name} - + ${address.building_name} + ${lines[0]} ${lines[1]} ${lines[2]} ${lines[3]} ${lines[4]} + ${address.street_name} ${address.city} ${address.country.code} ${address.country.name} ${address.subdivision.code} ${address.subdivision.name} + ${address.building_number} diff --git a/modules/edocument_uncefact/tests/test_module.py b/modules/edocument_uncefact/tests/test_module.py index abeef73fce..583698e496 100644 --- a/modules/edocument_uncefact/tests/test_module.py +++ b/modules/edocument_uncefact/tests/test_module.py @@ -30,21 +30,21 @@ def get_invoice(): Uom = pool.get('product.uom') address = Mock(spec=Address, - street="St sample, 15", + street_unstructured="St sample, 15", city="Scranton", postal_code="1000", subdivision=None, country=Mock(spec=Country, code='US'), ) - address.name = "Building A" + address.building_name = "Building A" address.country.name = "United States" party = Mock(spec=Party, addresses=[address]) party.name = "Michael Scott" company = Mock(spec=Company, party=Mock(spec=Party, addresses=[Mock(spec=Address, - street="Main street, 42", + street_unstructured="Main street, 42", country=Mock(spec=Country, code='US'))])) company.party.name = "Dunder Mifflin"