From e11f64f11fe0cd49496df9e4f02749b5dc477302 Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Fri, 8 Apr 2022 12:12:53 +0200 Subject: [PATCH] [FIX] Adjust price in USD for products used in tests env.ref("product.product_product_10") is a demo data we use in tests Prior to commit 86febae278f08864e83017d43f6aa9d67165d664 in odoo the original price (14.0 USD) was taken as EUR (from the company currency), and converted to 16.38 USD when added to a invoice with currency USD. This module used to convert it back to 14.0 EUR. After 86febae278f08864e83017d43f6aa9d67165d664, the product is added to a invoice with currency == USD with the correct price, 14.00, which is later converted to 11.97 EUR by this module. --- .../tests/data/IT06363391001_00015.xml | 12 ++++++------ .../tests/data/IT06363391001_00016.xml | 12 ++++++------ .../tests/test_fatturapa_xml_validation.py | 6 ++++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/l10n_it_fatturapa_out/tests/data/IT06363391001_00015.xml b/l10n_it_fatturapa_out/tests/data/IT06363391001_00015.xml index 0aab977ff77b..07f44f0d129f 100644 --- a/l10n_it_fatturapa_out/tests/data/IT06363391001_00015.xml +++ b/l10n_it_fatturapa_out/tests/data/IT06363391001_00015.xml @@ -64,7 +64,7 @@ EUR 2021-12-16 INV/2021/12/0001 - 14.00 + 11.97 SI @@ -74,21 +74,21 @@ Cabinet with Doors 1.000 Unit(s) - 14.00000 - 14.00 + 11.96581 + 11.97 0.00 N3.2 Valuta USD - 16.38000 + 14.00000 2021-12-16 0.00 N3.2 - 14.00 + 11.97 0.00 Not subject to VAT law @@ -98,7 +98,7 @@ MP05 2022-01-31 - 14.00 + 11.97 diff --git a/l10n_it_fatturapa_out/tests/data/IT06363391001_00016.xml b/l10n_it_fatturapa_out/tests/data/IT06363391001_00016.xml index ca62e8138b71..ce25d80a53e6 100644 --- a/l10n_it_fatturapa_out/tests/data/IT06363391001_00016.xml +++ b/l10n_it_fatturapa_out/tests/data/IT06363391001_00016.xml @@ -64,7 +64,7 @@ USD 2021-12-16 INV/2021/12/0001 - 16.38 + 14.00 SI @@ -74,21 +74,21 @@ Cabinet with Doors 1.000 Unit(s) - 14.00000 - 14.00 + 11.96581 + 11.97 0.00 N3.2 Valuta USD - 16.38000 + 14.00000 2021-12-16 0.00 N3.2 - 14.00 + 11.97 0.00 Not subject to VAT law @@ -98,7 +98,7 @@ MP05 2022-01-31 - 16.38 + 14.00 diff --git a/l10n_it_fatturapa_out/tests/test_fatturapa_xml_validation.py b/l10n_it_fatturapa_out/tests/test_fatturapa_xml_validation.py index efcfdb971039..36610d1ab8b9 100644 --- a/l10n_it_fatturapa_out/tests/test_fatturapa_xml_validation.py +++ b/l10n_it_fatturapa_out/tests/test_fatturapa_xml_validation.py @@ -732,6 +732,12 @@ def test_15_xml_export(self): invoice = invoice_form.save() invoice.action_post() + # commit 86febae278f08864e83017d43f6aa9d67165d664 fixed this as + # a side effect: now the price is actually 14.00 USD not 16.38 + # for env.ref("product.product_product_10") + # self.assertEqual(invoice.invoice_line_ids[0].price_unit, 16.38) + self.assertEqual(invoice.invoice_line_ids[0].price_unit, 14.00) + invoice.company_id.xml_divisa_value = "force_eur" res = self.run_wizard(invoice.id) attachment = self.attach_model.browse(res["res_id"])