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

[UPD] Update base_comment_template.pot

[UPD] README.rst

base_comment_template 14.0.3.0.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-14.0/reporting-engine-14.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template/
This commit is contained in:
Mihai Fekete
2022-01-10 16:49:29 +02:00
committed by Jesús Alan Ramos Rodríguez
parent 34c1ec81eb
commit e4f65828bb
82 changed files with 8388 additions and 29 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 ""