mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[FIX] base_comment_template: Filter domain correctly
1. Safe eval domain before checking if it is defined. This makes [] be "False" on the first check, and provides the proper use case for when the domain is empty 2. Use filtered_domain in record instead of a search in self. When on a compute, we are on a NewId context, so the search would always fail TT29309
This commit is contained in:
@@ -39,7 +39,6 @@ class CommentTemplate(models.AbstractModel):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
for template in templates:
|
for template in templates:
|
||||||
if not template.domain or self in self.search(
|
domain = safe_eval(template.domain)
|
||||||
safe_eval(template.domain)
|
if not domain or record.filtered_domain(domain):
|
||||||
):
|
|
||||||
record.comment_template_ids = [(4, template.id)]
|
record.comment_template_ids = [(4, template.id)]
|
||||||
|
|||||||
Reference in New Issue
Block a user