[FIX] ir_actions: ids of unlink method can either be an ID list or one ID
This commit is contained in:
@@ -62,6 +62,10 @@ class actions(osv.osv):
|
||||
"""unlink ir.action.todo 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."""
|
||||
todo_obj = self.pool.get('ir.actions.todo')
|
||||
if not ids:
|
||||
return True
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
todo_ids = todo_obj.search(cr, uid, [('action_id', 'in', ids)], context=context)
|
||||
todo_obj.unlink(cr, uid, todo_ids, context=context)
|
||||
return super(actions, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
Reference in New Issue
Block a user