[14.0] [FIX] Fix base comment template rendering.#574
Conversation
ddd441f to
63e51f7
Compare
|
@petrus-v I just saw your PR (#495), can you review this one if you have time. |
petrus-v
left a comment
There was a problem hiding this comment.
This is a great addition to be able to use rendering engine in templates, could you add a note in the module description to tell which rendering engine are supported and eventually how to use it !
thanks
16f74c5 to
7fcf8d4
Compare
|
@petrus-v I updated the code, i also added a preview button in comments (that's why the tests percentage is smaller). |
|
@petrus-v any chance for this PR ? |
|
@feketemihai can you please rebase? |
7982290 to
9931623
Compare
@GSLabIt Done. |
|
@petrus-v do you have some time to take a look? or anyone at @OCA/reporting-engine-maintainers thanks :) |
petrus-v
left a comment
There was a problem hiding this comment.
Sorry to be slow on review.... Thanks to taken care my points.
great! @OCA/reporting-engine-maintainers can we merge? |
|
/ocabot merge major |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 356816f. Thanks a lot for contributing to OCA. ❤️ |
| @api.depends("model_id") | ||
| def _compute_no_record(self): | ||
| for preview in self: | ||
| domain = safe_eval(self.base_comment_template_id.domain) |
There was a problem hiding this comment.
Wrong use of self apparently. This probably works only because you (almost) never loop on more than one wizard
| ): | ||
| wizard.body = wizard.resource_ref.with_context( | ||
| lang=wizard.lang | ||
| ).render_comment(self.base_comment_template_id, engine=wizard.engine) |
|
@feketemihai could you address @simahawk remarks? |
The template comments are loaded in report with t t-raw, which is not allowing a double rendering if we have some dynamic content in the templates, so with this pr, we are allowing dynamic content in comment templates.
I will create PR for reports with the new method in t-raw.