From 8b8819c49412efb56f2724afd6d77f641362833a Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Fri, 19 Jan 2024 12:02:54 +0100 Subject: [PATCH] [FIX] sale_mrp, sale_mrp_margin: deduplicate tests By inheriting from a test class that contains test methods, these tests are executed twice. closes odoo/odoo#150272 X-original-commit: 835f600eac6fd1ec202cd21876457b14d3d0af06 Signed-off-by: William Henrotin (whe) Signed-off-by: Christophe Monniez (moc) --- addons/sale_mrp/tests/test_sale_mrp_flow.py | 6 ++++-- addons/sale_mrp_margin/tests/test_sale_mrp_flow.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/sale_mrp/tests/test_sale_mrp_flow.py b/addons/sale_mrp/tests/test_sale_mrp_flow.py index 9941679d588..c6499f4b1a9 100644 --- a/addons/sale_mrp/tests/test_sale_mrp_flow.py +++ b/addons/sale_mrp/tests/test_sale_mrp_flow.py @@ -9,8 +9,7 @@ from odoo.addons.stock_account.tests.test_stockvaluation import _create_accounti # these tests create accounting entries, and therefore need a chart of accounts -@common.tagged('post_install', '-at_install') -class TestSaleMrpFlow(ValuationReconciliationTestCommon): +class TestSaleMrpFlowCommon(ValuationReconciliationTestCommon): @classmethod def setUpClass(cls, chart_template_ref=None): @@ -237,6 +236,9 @@ class TestSaleMrpFlow(ValuationReconciliationTestCommon): move_line.quantity = qty_to_process[comp][0] move._action_done() + +@common.tagged('post_install', '-at_install') +class TestSaleMrpFlow(TestSaleMrpFlowCommon): def test_00_sale_mrp_flow(self): """ Test sale to mrp flow with diffrent unit of measure.""" diff --git a/addons/sale_mrp_margin/tests/test_sale_mrp_flow.py b/addons/sale_mrp_margin/tests/test_sale_mrp_flow.py index b860e1da6ee..19c42aefab4 100644 --- a/addons/sale_mrp_margin/tests/test_sale_mrp_flow.py +++ b/addons/sale_mrp_margin/tests/test_sale_mrp_flow.py @@ -6,7 +6,7 @@ from odoo.tests import common, Form @common.tagged('post_install', '-at_install') -class TestSaleMrpFlow(test_sale_mrp_flow.TestSaleMrpFlow): +class TestSaleMrpFlow(test_sale_mrp_flow.TestSaleMrpFlowCommon): def test_kit_cost_calculation(self): """ Check that the average cost price is computed correctly after SO confirmation: