diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py index 8f2d289fbed..1b3916c8d56 100644 --- a/odoo/addons/base/models/ir_actions.py +++ b/odoo/addons/base/models/ir_actions.py @@ -109,6 +109,7 @@ class IrActions(models.Model): WHERE a.binding_model_id=m.id AND m.model=%s ORDER BY a.id """ cr.execute(query, [model_name]) + IrModelAccess = self.env['ir.model.access'] # discard unauthorized actions, and read action definitions result = defaultdict(list) @@ -117,9 +118,13 @@ class IrActions(models.Model): try: action = self.env[action_model].browse(action_id) action_groups = getattr(action, 'groups_id', ()) + action_model = getattr(action, 'res_model', False) if action_groups and not action_groups & user_groups: # the user may not perform this action continue + if action_model and not IrModelAccess.check(action_model, mode='read', raise_exception=False): + # the user won't be able to read records + continue result[binding_type].append(action.read()[0]) except (AccessError, MissingError): continue