diff --git a/stock_archive_constraint/tests/test_location_archive_constraint.py b/stock_archive_constraint/tests/test_location_archive_constraint.py index 96b4812fe..35cac97d0 100644 --- a/stock_archive_constraint/tests/test_location_archive_constraint.py +++ b/stock_archive_constraint/tests/test_location_archive_constraint.py @@ -9,6 +9,16 @@ class TestLocationArchiveConstraint(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() + # Remove this variable in v16 and put instead: + # from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + DISABLED_MAIL_CONTEXT = { + "tracking_disable": True, + "mail_create_nolog": True, + "mail_create_nosubscribe": True, + "mail_notrack": True, + "no_reset_password": True, + } + cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) cls.env = cls.env( context=dict(cls.env.context, test_stock_archive_constraint=True) ) diff --git a/stock_lot_filter_available/tests/test_stock_lot_filter_available.py b/stock_lot_filter_available/tests/test_stock_lot_filter_available.py index ad160bb80..eec15f7bf 100644 --- a/stock_lot_filter_available/tests/test_stock_lot_filter_available.py +++ b/stock_lot_filter_available/tests/test_stock_lot_filter_available.py @@ -8,6 +8,16 @@ class TestStockLotFilterAvailable(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() + # Remove this variable in v16 and put instead: + # from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + DISABLED_MAIL_CONTEXT = { + "tracking_disable": True, + "mail_create_nolog": True, + "mail_create_nosubscribe": True, + "mail_notrack": True, + "no_reset_password": True, + } + cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) cls.StockProductionLot = cls.env["stock.production.lot"] cls.company = cls.env.ref("base.main_company") cls.loc = cls.env.ref("stock.stock_location_stock") diff --git a/stock_move_location/tests/test_common.py b/stock_move_location/tests/test_common.py index ff02a388f..004047a8e 100644 --- a/stock_move_location/tests/test_common.py +++ b/stock_move_location/tests/test_common.py @@ -9,7 +9,16 @@ class TestsCommon(common.TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() - cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + # Remove this variable in v16 and put instead: + # from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + DISABLED_MAIL_CONTEXT = { + "tracking_disable": True, + "mail_create_nolog": True, + "mail_create_nosubscribe": True, + "mail_notrack": True, + "no_reset_password": True, + } + cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) cls.location_obj = cls.env["stock.location"] product_obj = cls.env["product.product"] cls.wizard_obj = cls.env["wiz.stock.move.location"] diff --git a/stock_putaway_product_template/tests/test_stock_putaway_rule.py b/stock_putaway_product_template/tests/test_stock_putaway_rule.py index 085c50e62..4d8a8cb78 100644 --- a/stock_putaway_product_template/tests/test_stock_putaway_rule.py +++ b/stock_putaway_product_template/tests/test_stock_putaway_rule.py @@ -9,6 +9,16 @@ class TestStockPutawayRule(common.TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() + # Remove this variable in v16 and put instead: + # from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + DISABLED_MAIL_CONTEXT = { + "tracking_disable": True, + "mail_create_nolog": True, + "mail_create_nosubscribe": True, + "mail_notrack": True, + "no_reset_password": True, + } + cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) cls.putawayRuleObj = cls.env["stock.putaway.rule"] ProductTemplate = cls.env["product.template"] ProductAttribute = cls.env["product.attribute"] diff --git a/stock_quant_cost_info/tests/test_stock_quant_cost_info.py b/stock_quant_cost_info/tests/test_stock_quant_cost_info.py index cf8dbe129..db3c3fdce 100644 --- a/stock_quant_cost_info/tests/test_stock_quant_cost_info.py +++ b/stock_quant_cost_info/tests/test_stock_quant_cost_info.py @@ -7,13 +7,24 @@ from odoo.tests.common import TransactionCase, tagged @tagged("post_install", "-at_install") class TestStockQuantCostInfo(TransactionCase): - def setUp(self): - super().setUp() - product_obj = self.env["product.product"] - self.product_1 = product_obj.create( + @classmethod + def setUpClass(cls): + super().setUpClass() + # Remove this variable in v16 and put instead: + # from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + DISABLED_MAIL_CONTEXT = { + "tracking_disable": True, + "mail_create_nolog": True, + "mail_create_nosubscribe": True, + "mail_notrack": True, + "no_reset_password": True, + } + cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) + product_obj = cls.env["product.product"] + cls.product_1 = product_obj.create( {"name": "product test 1", "type": "product", "standard_price": 1000} ) - self.product_2 = product_obj.create( + cls.product_2 = product_obj.create( {"name": "product test 2", "type": "product", "standard_price": 2000} ) diff --git a/stock_secondary_unit/tests/test_stock_secondary_unit.py b/stock_secondary_unit/tests/test_stock_secondary_unit.py index 7a300ec05..3d21df4da 100644 --- a/stock_secondary_unit/tests/test_stock_secondary_unit.py +++ b/stock_secondary_unit/tests/test_stock_secondary_unit.py @@ -8,6 +8,16 @@ class TestProductSecondaryUnit(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() + # Remove this variable in v16 and put instead: + # from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + DISABLED_MAIL_CONTEXT = { + "tracking_disable": True, + "mail_create_nolog": True, + "mail_create_nosubscribe": True, + "mail_notrack": True, + "no_reset_password": True, + } + cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) # Active multiple units of measure security group for user cls.env.user.groups_id = [(4, cls.env.ref("uom.group_uom").id)] cls.StockPicking = cls.env["stock.picking"]