mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] base_comment_template: Improved sentences on fields
This commit is contained in:
committed by
Víctor Martínez
parent
e1011fa519
commit
8fef4ecdba
@@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
|
||||
<title>Base Comments Templates</title>
|
||||
<style type="text/css">
|
||||
|
||||
@@ -367,12 +367,21 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>Add a new model to define templates of comments to print on
|
||||
documents.</p>
|
||||
<p>Two positions are available for the comments:
|
||||
* above document lines
|
||||
* below document lines</p>
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/base_comment_template"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-base_comment_template"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>Add a new mixin class to define templates of comments to print on documents.
|
||||
The comment templates can be defined like make templates, so you can use variables from linked models.</p>
|
||||
<p>Two positions are available for the comments:</p>
|
||||
<ul class="simple">
|
||||
<li>above document lines (before_lines)</li>
|
||||
<li>below document lines (after_lines)</li>
|
||||
</ul>
|
||||
<p>The template are general, and can be attached to any Model and based on some domain defined in the template.
|
||||
You can define one default template per Model and domain, which can be overwritten for any company and partners.
|
||||
It has a priority field (smaller number = higher priority)</p>
|
||||
<p>In existing reports, if you add this line will get the comment template if you created one like</p>
|
||||
<ul class="simple">
|
||||
<li><span t-raw=”o.get_comment_template(‘position’,company_id=o.company_id, partner_id=o.parnter_id )”/> ( or without any parameter)</li>
|
||||
</ul>
|
||||
<p>This module is the base module for following modules:</p>
|
||||
<ul class="simple">
|
||||
<li>sale_comment_template</li>
|
||||
@@ -383,33 +392,75 @@ documents.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
|
||||
<p>Go to <em>Settings > Technical > Reporting > Comment Templates</em> and start designing you comment templates.</p>
|
||||
<p>This module is the base module for following modules:</p>
|
||||
<ul class="simple">
|
||||
<li>sale_comment_template</li>
|
||||
<li>purchase_comment_template</li>
|
||||
<li>invoice_comment_template</li>
|
||||
<li>stock_picking_comment_template</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to <em>Settings</em> and activate the developer mode.</li>
|
||||
<li>Go to <em>Settings > Technical > Reporting > Comment Templates</em>.</li>
|
||||
<li>Create a new record.</li>
|
||||
<li>Define the Company the template is linked or leave default for all companies.</li>
|
||||
<li>Define the Partner the template is linked or leave default for all partners.</li>
|
||||
<li>Define the Model, Domain the template is linked.</li>
|
||||
<li>Define the Position where the template will be printed:<ul>
|
||||
<li>above document lines</li>
|
||||
<li>below document lines</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
<p>You should have at least one template with Default field set, if you choose a Partner the template is deselected as a Default one.
|
||||
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>
|
||||
<p>You should always use t-if since the method returns False if no template is found.</p>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20base_comment_template%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20base_comment_template%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Camptocamp</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Xavier Jimenez <<a class="reference external" href="mailto:xavier.jimenez@qubiq.es">xavier.jimenez@qubiq.es</a>></li>
|
||||
<li>Nicolas Bessi <<a class="reference external" href="mailto:nicolas.bessi@camptocamp.com">nicolas.bessi@camptocamp.com</a>></li>
|
||||
@@ -424,17 +475,24 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<li>Iván Todorovich <<a class="reference external" href="mailto:ivan.todorovich@druidoo.io">ivan.todorovich@druidoo.io</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Pierre Verkest <<a class="reference external" href="mailto:pierreverkest84@gmail.com">pierreverkest84@gmail.com</a>></li>
|
||||
<li><a class="reference external" href="https://www.nexterp.ro">NextERP Romania</a>:<ul>
|
||||
<li>Fekete Mihai <<a class="reference external" href="mailto:feketemihai@nexterp.ro">feketemihai@nexterp.ro</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||
<li>Carlos Roca</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/base_comment_template">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user