[FIX] Base: Remove invalid User-Defined Filters
closes odoo/odoo#156622 Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
This commit is contained in:
@@ -15,3 +15,4 @@ List of contributors:
|
||||
Daniel Dico ddico@oerp.ca https://github.com/ddico
|
||||
Yash Pathak yp@oerp.ca https://github.com/yp-oerp
|
||||
Lucas Jagel lj@oerp.ca https://github.com/lj-oerp
|
||||
Daryl Chen dc@oerp.ca https://github.com/dc-oerp
|
||||
|
||||
@@ -86,10 +86,12 @@ class IrActions(models.Model):
|
||||
return res
|
||||
|
||||
def unlink(self):
|
||||
"""unlink ir.action.todo which are related to actions which will be deleted.
|
||||
"""unlink ir.action.todo/ir.filters which are related to actions which will be deleted.
|
||||
NOTE: ondelete cascade will not work on ir.actions.actions so we will need to do it manually."""
|
||||
todos = self.env['ir.actions.todo'].search([('action_id', 'in', self.ids)])
|
||||
todos.unlink()
|
||||
filters = self.env['ir.filters'].search([('action_id', 'in', self.ids)])
|
||||
filters.unlink()
|
||||
res = super(IrActions, self).unlink()
|
||||
# self.get_bindings() depends on action records
|
||||
self.env.registry.clear_cache()
|
||||
|
||||
Reference in New Issue
Block a user