From d2fb479d31a96da038d32b00befba69aa126ff7b Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Thu, 9 Jun 2022 14:56:15 +0000 Subject: [PATCH] [FIX] mrp: settings user unable to save settings Settings user is not able to access Bill of Material (mrp.bom) records unless they have additional groups (account, inventory, manufacturing, ...) This commit makes sure the operation is done in sudo so that any setting user is able to save the settings. Part-of: odoo/odoo#91909 --- addons/mrp/models/res_config_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/res_config_settings.py b/addons/mrp/models/res_config_settings.py index c598fe20344..52d8b7b2b95 100644 --- a/addons/mrp/models/res_config_settings.py +++ b/addons/mrp/models/res_config_settings.py @@ -27,7 +27,7 @@ class ResConfigSettings(models.TransientModel): super().set_values() if not self.group_mrp_workorder_dependencies: # Disabling this option should not interfere with currently planned productions - self.env['mrp.bom'].search([('allow_operation_dependencies', '=', True)]).allow_operation_dependencies = False + self.env['mrp.bom'].sudo().search([('allow_operation_dependencies', '=', True)]).allow_operation_dependencies = False @api.onchange('use_manufacturing_lead') def _onchange_use_manufacturing_lead(self):