[FIX] mrp_account: fix BoM creation test without demo data

The test needs to set `product_id` field in order to check user's
access. However, the field is not visible without enabling product
variants, which makes the test fail in an environment with no demo data.
This commit fixes the issue by adding the MRP manager to the
'product.group_product_variant' group.

The issue was introduced in #162107 .

Related build error:

https://runbot.odoo.com/web#id=61998&cids=1&menu_id=405&action=573&model=runbot.build.error&view_type=form

closes odoo/odoo#162873

X-original-commit: 00b317b114cd139a4ea03a1e660e1b549f829130
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Pawel Fertyk (pafe) <pafe@odoo.com>
This commit is contained in:
Paweł Fertyk
2024-04-24 09:28:16 +00:00
parent 91184dcd84
commit 6f39d0ee5f
+1 -1
View File
@@ -191,7 +191,7 @@ class TestMrpAccount(TestMrpCommon):
def test_stock_user_without_account_permissions_can_create_bom(self):
mrp_manager = new_test_user(
self.env, 'temp_mrp_manager', 'mrp.group_mrp_manager',
self.env, 'temp_mrp_manager', 'mrp.group_mrp_manager,product.group_product_variant',
)
bom_form = Form(self.env['mrp.bom'].with_user(mrp_manager))