[FIX] ir_actions: home action restriction
Steps to reproduce: - define a home action for the user - delete the action in configuration > Window Action - refresh to the home page -> id not found Solution: - prevent the deletion of a window action if used as a home action OPW-2728824 closes odoo/odoo#89420 X-original-commit: b868583690d8560d3cc300b9448f0af32f41d81a Signed-off-by: yosa-odoo <yosa@odoo.com>
This commit is contained in:
@@ -66,6 +66,10 @@ class IrActions(models.Model):
|
||||
self.clear_caches()
|
||||
return res
|
||||
|
||||
@api.ondelete(at_uninstall=True)
|
||||
def _unlink_check_home_action(self):
|
||||
self.env['res.users'].with_context(active_test=False).search([('action_id', 'in', self.ids)]).sudo().write({'action_id': None})
|
||||
|
||||
@api.model
|
||||
def _get_eval_context(self, action=None):
|
||||
""" evaluation context to pass to safe_eval """
|
||||
|
||||
Reference in New Issue
Block a user