Skip to content

Commit ee8b480

Browse files
committed
[FIX] account_edi_ubl_cii,*: Line/Description full value
*: l10n_ro_edi When a user generate a UBL XML that inherits from ubl 2.0, the Item/Description xml node will only contain the information about the product name, without any description. This commit aims at restoring the behavior before saas-17.4 and gives the full description on that XML value. To make sure it keeps this new behavior, a test was modified in l10n_ro_edi (the ticket origin) to make sure the Description display the `line.name` The change was previously introduced in odoo@4f325ef Similar fix to l10n_es_edi_facturae for reference: odoo#180315 opw-4213014 closes odoo#181877 Signed-off-by: Wala Gauthier (gawa) <[email protected]> Signed-off-by: Yosua Nicolaus (yoni) <[email protected]>
1 parent 1b13fed commit ee8b480

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def _get_invoice_line_item_vals(self, line, taxes_vals):
225225
customer = line.move_id.commercial_partner_id
226226
supplier = line.move_id.company_id.partner_id.commercial_partner_id
227227
tax_category_vals_list = self._get_tax_category_list(customer, supplier, taxes)
228-
description = (line.product_id.display_name and line.product_id.display_name.replace('\n', ', ')) or (line.name and line.name.replace('\n', ', '))
228+
description = line.name and line.name.replace('\n', ', ')
229229
return {
230230
'description': description,
231231
'name': product.name or description,

addons/l10n_ro_edi/tests/test_files/from_odoo/ciusro_out_invoice.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<cbc:InvoicedQuantity unitCode="C62">1.0</cbc:InvoicedQuantity>
131131
<cbc:LineExtensionAmount currencyID="RON">500.00</cbc:LineExtensionAmount>
132132
<cac:Item>
133-
<cbc:Description>product_a</cbc:Description>
133+
<cbc:Description>Test Product A</cbc:Description>
134134
<cbc:Name>product_a</cbc:Name>
135135
<cac:ClassifiedTaxCategory>
136136
<cbc:ID>S</cbc:ID>
@@ -149,7 +149,7 @@
149149
<cbc:InvoicedQuantity unitCode="DZN">1.0</cbc:InvoicedQuantity>
150150
<cbc:LineExtensionAmount currencyID="RON">1000.00</cbc:LineExtensionAmount>
151151
<cac:Item>
152-
<cbc:Description>product_b</cbc:Description>
152+
<cbc:Description>Test Product B</cbc:Description>
153153
<cbc:Name>product_b</cbc:Name>
154154
<cac:ClassifiedTaxCategory>
155155
<cbc:ID>S</cbc:ID>

addons/l10n_ro_edi/tests/test_files/from_odoo/ciusro_out_invoice_different_currency.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<cbc:InvoicedQuantity unitCode="C62">1.0</cbc:InvoicedQuantity>
134134
<cbc:LineExtensionAmount currencyID="USD">500.00</cbc:LineExtensionAmount>
135135
<cac:Item>
136-
<cbc:Description>product_a</cbc:Description>
136+
<cbc:Description>Test Product A</cbc:Description>
137137
<cbc:Name>product_a</cbc:Name>
138138
<cac:ClassifiedTaxCategory>
139139
<cbc:ID>S</cbc:ID>
@@ -152,7 +152,7 @@
152152
<cbc:InvoicedQuantity unitCode="DZN">1.0</cbc:InvoicedQuantity>
153153
<cbc:LineExtensionAmount currencyID="USD">1000.00</cbc:LineExtensionAmount>
154154
<cac:Item>
155-
<cbc:Description>product_b</cbc:Description>
155+
<cbc:Description>Test Product B</cbc:Description>
156156
<cbc:Name>product_b</cbc:Name>
157157
<cac:ClassifiedTaxCategory>
158158
<cbc:ID>S</cbc:ID>

addons/l10n_ro_edi/tests/test_files/from_odoo/ciusro_out_invoice_no_prefix_vat.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<cbc:InvoicedQuantity unitCode="C62">1.0</cbc:InvoicedQuantity>
131131
<cbc:LineExtensionAmount currencyID="RON">500.00</cbc:LineExtensionAmount>
132132
<cac:Item>
133-
<cbc:Description>product_a</cbc:Description>
133+
<cbc:Description>Test Product A</cbc:Description>
134134
<cbc:Name>product_a</cbc:Name>
135135
<cac:ClassifiedTaxCategory>
136136
<cbc:ID>S</cbc:ID>
@@ -149,7 +149,7 @@
149149
<cbc:InvoicedQuantity unitCode="DZN">1.0</cbc:InvoicedQuantity>
150150
<cbc:LineExtensionAmount currencyID="RON">1000.00</cbc:LineExtensionAmount>
151151
<cac:Item>
152-
<cbc:Description>product_b</cbc:Description>
152+
<cbc:Description>Test Product B</cbc:Description>
153153
<cbc:Name>product_b</cbc:Name>
154154
<cac:ClassifiedTaxCategory>
155155
<cbc:ID>S</cbc:ID>

addons/l10n_ro_edi/tests/test_files/from_odoo/ciusro_out_refund.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<cbc:CreditedQuantity unitCode="C62">1.0</cbc:CreditedQuantity>
131131
<cbc:LineExtensionAmount currencyID="RON">500.00</cbc:LineExtensionAmount>
132132
<cac:Item>
133-
<cbc:Description>product_a</cbc:Description>
133+
<cbc:Description>Test Product A</cbc:Description>
134134
<cbc:Name>product_a</cbc:Name>
135135
<cac:ClassifiedTaxCategory>
136136
<cbc:ID>S</cbc:ID>
@@ -149,7 +149,7 @@
149149
<cbc:CreditedQuantity unitCode="DZN">1.0</cbc:CreditedQuantity>
150150
<cbc:LineExtensionAmount currencyID="RON">1000.00</cbc:LineExtensionAmount>
151151
<cac:Item>
152-
<cbc:Description>product_b</cbc:Description>
152+
<cbc:Description>Test Product B</cbc:Description>
153153
<cbc:Name>product_b</cbc:Name>
154154
<cac:ClassifiedTaxCategory>
155155
<cbc:ID>S</cbc:ID>

addons/l10n_ro_edi/tests/test_xml_ubl_ro.py

+2
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ def create_move(self, move_type, send=True, **kwargs):
6161
move_type=move_type,
6262
invoice_line_ids=[
6363
{
64+
'name': 'Test Product A',
6465
'product_id': self.product_a.id,
6566
'price_unit': 500.0,
6667
'tax_ids': [Command.set(self.tax_19.ids)],
6768
},
6869
{
70+
'name': 'Test Product B',
6971
'product_id': self.product_b.id,
7072
'price_unit': 1000.0,
7173
'tax_ids': [Command.set(self.tax_19.ids)],

0 commit comments

Comments
 (0)