[14.0] [FIX] Fix base comment template rendering.

This commit is contained in:
Mihai Fekete
2022-01-10 16:49:29 +02:00
parent 93a005f241
commit 9931623c40
11 changed files with 270 additions and 12 deletions

View File

@@ -42,3 +42,17 @@ class CommentTemplate(models.AbstractModel):
domain = safe_eval(template.domain)
if not domain or record.filtered_domain(domain):
record.comment_template_ids = [(4, template.id)]
def render_comment(
self, comment, engine="jinja", add_context=None, post_process=False
):
self.ensure_one()
comment_texts = self.env["mail.render.mixin"]._render_template(
comment.text,
self._name,
[self.id],
engine=engine,
add_context=add_context,
post_process=post_process,
)
return comment_texts[self.id] or ""