mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[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:
committed by
Jesús Alan Ramos Rodríguez
parent
34c1ec81eb
commit
e4f65828bb
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user