From dfdaa9e5fe76a9d6573f779f79ff65d8253b8a6f Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Tue, 3 Oct 2023 15:25:08 +0200 Subject: [PATCH] [FIX] repair: avoid running test without necessary module Previous fix odoo/odoo#135784 added a test to repair that references a sale_order_line field that only exists when the sale_margin module is installed. Unfortunately there isn't already a common module that requires both repair + sale_margin and runbot doesn't do single module app tests so this test slipped through the cracks. To avoid the error when the nightly single module tests occur, we avoid running the test when sale_margin is installed since it will still run during standard runbot tests and ensure that the bug doesn't return. closes odoo/odoo#137490 X-original-commit: 6343e2f3125bb48b01bf5b1ef7be36d86ae35f86 Signed-off-by: William Henrotin (whe) Signed-off-by: Tiffany Chang (tic) --- addons/repair/tests/test_repair.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/repair/tests/test_repair.py b/addons/repair/tests/test_repair.py index 90eed4c8423..e905ed04efa 100644 --- a/addons/repair/tests/test_repair.py +++ b/addons/repair/tests/test_repair.py @@ -507,6 +507,8 @@ class TestRepair(common.TransactionCase): Test that the purchase price is correctly set on the SO line, when creating a SO from a repair order. """ + if not self.env['ir.module.module'].search([('name', '=', 'sale_margin'), ('state', '=', 'installed')]): + self.skipTest("sale_margin is not installed, so there is no purchase price to test") self.product_product_11.standard_price = 10 repair = self.env['repair.order'].create({ 'partner_id': self.res_partner_1.id,