Skip to content

Commit

Permalink
[FIX] web_advanced_filter: prevent error on filter delete
Browse files Browse the repository at this point in the history
The wizard that adds criteria to a filter maintains a reference to that filter. That makes it
impossible to delete the filter pointed to. By changing the filter_id field to delete cascade,
this problem is solved.
  • Loading branch information
NL66278 committed Mar 15, 2022
1 parent 38b3fe9 commit 06e451c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ class IrFiltersCombineWithExisting(models.TransientModel):
domain = fields.Char('Domain', required=True)
context = fields.Char('Context', required=True, default='{}')
model = fields.Char('Model', required=True)
filter_id = fields.Many2one('ir.filters', 'Filter', required=True)
filter_id = fields.Many2one(
comodel_name='ir.filters',
string='Filter',
ondelete='cascade',
index=True,
required=True
)

@api.multi
def button_save(self):
Expand Down

0 comments on commit 06e451c

Please sign in to comment.