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
@@ -433,15 +433,30 @@ It has a priority field (smaller number = higher priority)</p>
|
||||
If you create a new template with the same configuration (Model, Domain, Position) and set it as Default, the previous one will be deselected as a default one.</p>
|
||||
<p>The template is a html field which will be rendered just like a mail template, so you can use variables like ${object}, ${user}, ${ctx} to add dynamic content.</p>
|
||||
<p>Change the report related to the model from configuration and add a statement like:</p>
|
||||
<p><p t-if=”o.get_comment_template(‘before_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”></p>
|
||||
<blockquote>
|
||||
<span t-raw=”o.get_comment_template(‘before_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”/></blockquote>
|
||||
<p></p></p>
|
||||
<p><p t-if=”o.get_comment_template(‘after_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”></p>
|
||||
<blockquote>
|
||||
<span t-raw=”o.get_comment_template(‘after_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”/></blockquote>
|
||||
<p></p></p>
|
||||
<dl class="docutils">
|
||||
<dt><t t-foreach=”o.comment_template_ids.filtered(lambda x: x.position == ‘before_lines’)” t-as=”comment_template_top”></dt>
|
||||
<dd><div t-raw=”o.render_comment(comment_template_top)” /></dd>
|
||||
</dl>
|
||||
<p></t></p>
|
||||
<dl class="docutils">
|
||||
<dt><t t-foreach=”o.comment_template_ids.filtered(lambda x: x.position == ‘after_lines’)” t-as=”comment_template_bottom”></dt>
|
||||
<dd><div t-raw=”o.render_comment(comment_template_bottom)” /></dd>
|
||||
</dl>
|
||||
<p></t></p>
|
||||
<p>You should always use t-if since the method returns False if no template is found.</p>
|
||||
<p>If you want to use Qweb templates, or different context, you can specify it just like in
|
||||
mail.render.mixin with parameters:</p>
|
||||
<ul class="simple">
|
||||
<li>engine: “jinja” or “qweb”,</li>
|
||||
<li>add_context: dict with your own context,</li>
|
||||
<li>post_process: perform a post processing on rendered result</li>
|
||||
</ul>
|
||||
<p>so you could use it :</p>
|
||||
<dl class="docutils">
|
||||
<dt><t t-foreach=”o.comment_template_ids.filtered(lambda x: x.position == ‘before_lines’)” t-as=”comment_template_top”></dt>
|
||||
<dd><div t-raw=”o.render_comment(comment_template_top, engine=’qweb’, add_context={my dict}, postprocess=True)” /></dd>
|
||||
</dl>
|
||||
<p></t></p>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
|
||||
|
||||
Reference in New Issue
Block a user