diff --git a/addons/product/tests/test_name.py b/addons/product/tests/test_name.py index d168118383c..c814f6bbb8a 100644 --- a/addons/product/tests/test_name.py +++ b/addons/product/tests/test_name.py @@ -31,6 +31,8 @@ class TestName(TransactionCase): self.assertNotIn(self.product.id, res_ids) def test_product_template_search_name_no_product_product(self): + # To be able to test dynamic variant "variants" feature must be set up + self.env.user.write({'groups_id': [(4, self.env.ref('product.group_product_variant').id)]}) color_attr = self.env['product.attribute'].create({'name': 'Color', 'create_variant': 'dynamic'}) color_attr_value_r = self.env['product.attribute.value'].create({'name': 'Red', 'attribute_id': color_attr.id}) color_attr_value_b = self.env['product.attribute.value'].create({'name': 'Blue', 'attribute_id': color_attr.id}) diff --git a/addons/product/tests/test_variants.py b/addons/product/tests/test_variants.py index 379a2c59e14..349e99303f5 100644 --- a/addons/product/tests/test_variants.py +++ b/addons/product/tests/test_variants.py @@ -1026,6 +1026,8 @@ class TestVariantsArchive(ProductVariantsCommon): self.assertEqual(archived_variants, variants_2x0) def test_name_search_dynamic_attributes(self): + # To be able to test dynamic variant "variants" feature must be set up + self.env.user.write({'groups_id': [(4, self.env.ref('product.group_product_variant').id)]}) dynamic_attr = self.env['product.attribute'].create({ 'name': 'Dynamic', 'create_variant': 'dynamic',