From 6f39d0ee5f8aa2eab6f28e984eda2727cfe5f0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Fertyk?= Date: Mon, 22 Apr 2024 13:22:24 +0200 Subject: [PATCH] [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) Signed-off-by: Pawel Fertyk (pafe) --- addons/mrp_account/tests/test_mrp_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_account/tests/test_mrp_account.py b/addons/mrp_account/tests/test_mrp_account.py index 0277e140465..898e7d4425b 100644 --- a/addons/mrp_account/tests/test_mrp_account.py +++ b/addons/mrp_account/tests/test_mrp_account.py @@ -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))