From e610b35f9dfe12af62e50c8bc5d7edbaad0afc5d Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Thu, 23 Jun 2022 12:31:42 +0000 Subject: [PATCH] [FIX] purchase_mrp: set anglo_saxon flag in the test If the module `l10n_de` is installed, the test `test_kit_anglo_saxo_price_diff` will failed. This is because the flag `use_anglo_saxon` is not enabled by default in the chart template of German companies. Therefore, when posting the invoice, we skip the anglo-saxon lines generation: https://github.com/odoo/odoo/blob/f3ae759f2d54829f91badd32cacf70e8a8211288/addons/purchase_stock/models/account_invoice.py#L40-L42 This explains why the test fails. OPW-2843861 closes odoo/odoo#94548 X-original-commit: 5af6d0374f8e8e8dceb9b26f79e6b962ff96b60c Signed-off-by: Adrien Widart --- addons/purchase_mrp/tests/test_anglo_saxon_valuation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py b/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py index 53695146fe0..7a90eb48046 100644 --- a/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py +++ b/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py @@ -26,6 +26,8 @@ class TestAngloSaxonValuationPurchaseMRP(TransactionCase): 'property_stock_valuation_account_id': cls.stock_valuation_account.id, }) + cls.env.company.anglo_saxon_accounting = True + def test_kit_anglo_saxo_price_diff(self): """ Suppose an automated-AVCO configuration and a Price Difference Account defined on