Skip to content

Commit

Permalink
[FIX] base_comment_template: search when multiple models in a template
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHForgeFlow committed Jul 19, 2023
1 parent 0115fe4 commit fa2061c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base_comment_template/models/base_comment_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def name_get(self):
def _search_model_ids(self, operator, value):
# We cannot use model_ids.model in search() method to avoid recursion.
allowed_items = (
self.sudo().search([]).filtered(lambda x: x.model_ids.model == value)
self.sudo()
.search([])
.filtered(lambda x: value in x.model_ids.mapped("model"))
)
return [("id", "in", allowed_items.ids)]

0 comments on commit fa2061c

Please sign in to comment.