mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] base_comment_template: Migration to 15.0
TT35696
This commit is contained in:
committed by
Jesús Alan Ramos Rodríguez
parent
61973247ec
commit
1a9d3178f1
@@ -1 +1,4 @@
|
||||
from . import base_comment_template, comment_template, ir_model, res_partner
|
||||
from . import base_comment_template
|
||||
from . import comment_template
|
||||
from . import ir_model
|
||||
from . import res_partner
|
||||
|
||||
@@ -44,13 +44,13 @@ class CommentTemplate(models.AbstractModel):
|
||||
record.comment_template_ids = [(4, template.id)]
|
||||
|
||||
def render_comment(
|
||||
self, comment, engine="jinja", add_context=None, post_process=False
|
||||
self, comment, engine="inline_template", add_context=None, post_process=False
|
||||
):
|
||||
self.ensure_one()
|
||||
comment_texts = self.env["mail.render.mixin"]._render_template(
|
||||
comment.text,
|
||||
self._name,
|
||||
[self.id],
|
||||
template_src=comment.text,
|
||||
model=self._name,
|
||||
res_ids=[self.id],
|
||||
engine=engine,
|
||||
add_context=add_context,
|
||||
post_process=post_process,
|
||||
|
||||
@@ -14,7 +14,7 @@ class IrModel(models.Model):
|
||||
)
|
||||
|
||||
def _reflect_model_params(self, model):
|
||||
vals = super(IrModel, self)._reflect_model_params(model)
|
||||
vals = super()._reflect_model_params(model)
|
||||
vals["is_comment_template"] = issubclass(
|
||||
type(model), self.pool["comment.template"]
|
||||
)
|
||||
@@ -22,7 +22,7 @@ class IrModel(models.Model):
|
||||
|
||||
@api.model
|
||||
def _instanciate(self, model_data):
|
||||
model_class = super(IrModel, self)._instanciate(model_data)
|
||||
model_class = super()._instanciate(model_data)
|
||||
if (
|
||||
model_data.get("is_comment_template")
|
||||
and model_class._name != "comment.template"
|
||||
|
||||
Reference in New Issue
Block a user