mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] base_comment_template: pre-commit auto fixes
This commit is contained in:
9
base_comment_template/readme/CONFIGURE.md
Normal file
9
base_comment_template/readme/CONFIGURE.md
Normal file
@@ -0,0 +1,9 @@
|
||||
Go to *Settings \> Technical \> Reporting \> Comment Templates* and
|
||||
start designing you comment templates.
|
||||
|
||||
This module is the base module for following modules:
|
||||
|
||||
- sale_comment_template
|
||||
- purchase_comment_template
|
||||
- invoice_comment_template
|
||||
- stock_picking_comment_template
|
||||
@@ -1,8 +0,0 @@
|
||||
Go to *Settings > Technical > Reporting > Comment Templates* and start designing you comment templates.
|
||||
|
||||
This module is the base module for following modules:
|
||||
|
||||
* sale_comment_template
|
||||
* purchase_comment_template
|
||||
* invoice_comment_template
|
||||
* stock_picking_comment_template
|
||||
19
base_comment_template/readme/CONTRIBUTORS.md
Normal file
19
base_comment_template/readme/CONTRIBUTORS.md
Normal file
@@ -0,0 +1,19 @@
|
||||
- Xavier Jimenez \<<xavier.jimenez@qubiq.es>\>
|
||||
- Nicolas Bessi \<<nicolas.bessi@camptocamp.com>\>
|
||||
- Yannick Vaucher \<<yannick.vaucher@camptocamp.com>\>
|
||||
- Guewen Baconnier \<<guewen.baconnier@camptocamp.com>\>
|
||||
- Simone Rubino \<<simone.rubino@agilebg.com>\>
|
||||
- [DynApps](https://www.dynapps.be):
|
||||
- Raf Ven \<<raf.ven@dynapps.be>\>
|
||||
- [Druidoo](https://www.druidoo.io):
|
||||
- Iván Todorovich \<<ivan.todorovich@druidoo.io>\>
|
||||
- Pierre Verkest \<<pierreverkest84@gmail.com>\>
|
||||
- [NextERP Romania](https://www.nexterp.ro):
|
||||
- Fekete Mihai \<<feketemihai@nexterp.ro>\>
|
||||
- [Tecnativa](https://www.tecnativa.com):
|
||||
- Carlos Roca
|
||||
- Víctor Martínez
|
||||
- [Jarsa](https://www.jarsa.com):
|
||||
- Alan Ramos \<<alan.ramos@jarsa.com>\>
|
||||
- [Bloopark systems](https://www.bloopark.de/):
|
||||
- Achraf Mhadhbi \<<machraf@bloopark.de>\>
|
||||
@@ -1,30 +0,0 @@
|
||||
* Xavier Jimenez <xavier.jimenez@qubiq.es>
|
||||
* Nicolas Bessi <nicolas.bessi@camptocamp.com>
|
||||
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
|
||||
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
|
||||
* Simone Rubino <simone.rubino@agilebg.com>
|
||||
* `DynApps <https://www.dynapps.be>`_:
|
||||
|
||||
* Raf Ven <raf.ven@dynapps.be>
|
||||
|
||||
* `Druidoo <https://www.druidoo.io>`_:
|
||||
|
||||
* Iván Todorovich <ivan.todorovich@druidoo.io>
|
||||
* Pierre Verkest <pierreverkest84@gmail.com>
|
||||
|
||||
* `NextERP Romania <https://www.nexterp.ro>`_:
|
||||
|
||||
* Fekete Mihai <feketemihai@nexterp.ro>
|
||||
|
||||
* `Tecnativa <https://www.tecnativa.com>`_:
|
||||
|
||||
* Carlos Roca
|
||||
* Víctor Martínez
|
||||
|
||||
* `Jarsa <https://www.jarsa.com>`_:
|
||||
|
||||
* Alan Ramos <alan.ramos@jarsa.com>
|
||||
|
||||
* `Bloopark systems <https://www.bloopark.de/>`_:
|
||||
|
||||
* Achraf Mhadhbi <machraf@bloopark.de>
|
||||
27
base_comment_template/readme/DESCRIPTION.md
Normal file
27
base_comment_template/readme/DESCRIPTION.md
Normal file
@@ -0,0 +1,27 @@
|
||||
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.
|
||||
|
||||
Two positions are available for the comments:
|
||||
|
||||
- above document lines (before_lines)
|
||||
- below document lines (after_lines)
|
||||
|
||||
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)
|
||||
|
||||
In existing reports, if you add this line will get the comment template
|
||||
if you created one like
|
||||
|
||||
- \<span
|
||||
t-out="o.get_comment_template('position',company_id=o.company_id,
|
||||
partner_id=o.parnter_id )"/\> ( or without any parameter)
|
||||
|
||||
This module is the base module for following modules:
|
||||
|
||||
- sale_comment_template
|
||||
- purchase_comment_template
|
||||
- account_comment_template
|
||||
- stock_picking_comment_template
|
||||
@@ -1,23 +0,0 @@
|
||||
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.
|
||||
|
||||
Two positions are available for the comments:
|
||||
|
||||
* above document lines (before_lines)
|
||||
* below document lines (after_lines)
|
||||
|
||||
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)
|
||||
|
||||
In existing reports, if you add this line will get the comment template if you created one like
|
||||
|
||||
* <span t-out="o.get_comment_template('position',company_id=o.company_id, partner_id=o.parnter_id )"/> ( or without any parameter)
|
||||
|
||||
|
||||
This module is the base module for following modules:
|
||||
|
||||
* sale_comment_template
|
||||
* purchase_comment_template
|
||||
* account_comment_template
|
||||
* stock_picking_comment_template
|
||||
52
base_comment_template/readme/USAGE.md
Normal file
52
base_comment_template/readme/USAGE.md
Normal file
@@ -0,0 +1,52 @@
|
||||
1. Go to *Settings* and activate the developer mode.
|
||||
2. Go to *Settings \> Technical \> Reporting \> Comment Templates*.
|
||||
3. Create a new record.
|
||||
4. Define the Company the template is linked or leave default for all
|
||||
companies.
|
||||
5. Define the Partner the template is linked or leave default for all
|
||||
partners.
|
||||
6. Define the Model, Domain the template is linked.
|
||||
7. Define the Position where the template will be printed:
|
||||
- above document lines
|
||||
- below document lines
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Change the report related to the model from configuration and add a
|
||||
statement like:
|
||||
|
||||
\<t t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')" t-as="comment_template_top"\>
|
||||
\<div t-out="o.render_comment(comment_template_top)" /\>
|
||||
|
||||
\</t\>
|
||||
|
||||
\<t t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'after_lines')" t-as="comment_template_bottom"\>
|
||||
\<div t-out="o.render_comment(comment_template_bottom)" /\>
|
||||
|
||||
\</t\>
|
||||
|
||||
You should always use t-if since the method returns False if no template
|
||||
is found.
|
||||
|
||||
If you want to use Qweb templates, or different context, you can specify
|
||||
it just like in mail.render.mixin with parameters:
|
||||
|
||||
- engine: "inline_template", "qweb" or "qweb_view",
|
||||
- add_context: dict with your own context,
|
||||
- post_process: perform a post processing on rendered result
|
||||
|
||||
so you could use it :
|
||||
|
||||
\<t t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')" t-as="comment_template_top"\>
|
||||
\<div t-out="o.render_comment(comment_template_top, engine='qweb',
|
||||
add_context={my dict}, postprocess=True)" /\>
|
||||
|
||||
\</t\>
|
||||
@@ -1,44 +0,0 @@
|
||||
#. Go to *Settings* and activate the developer mode.
|
||||
#. Go to *Settings > Technical > Reporting > Comment Templates*.
|
||||
#. Create a new record.
|
||||
#. Define the Company the template is linked or leave default for all companies.
|
||||
#. Define the Partner the template is linked or leave default for all partners.
|
||||
#. Define the Model, Domain the template is linked.
|
||||
#. Define the Position where the template will be printed:
|
||||
|
||||
* above document lines
|
||||
* below document lines
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Change the report related to the model from configuration and add a statement like:
|
||||
|
||||
<t t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')" t-as="comment_template_top">
|
||||
<div t-out="o.render_comment(comment_template_top)" />
|
||||
|
||||
</t>
|
||||
|
||||
|
||||
<t t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'after_lines')" t-as="comment_template_bottom">
|
||||
<div t-out="o.render_comment(comment_template_bottom)" />
|
||||
|
||||
</t>
|
||||
|
||||
You should always use t-if since the method returns False if no template is found.
|
||||
|
||||
If you want to use Qweb templates, or different context, you can specify it just like in
|
||||
mail.render.mixin with parameters:
|
||||
|
||||
- engine: "inline_template", "qweb" or "qweb_view",
|
||||
- add_context: dict with your own context,
|
||||
- post_process: perform a post processing on rendered result
|
||||
|
||||
so you could use it :
|
||||
|
||||
<t t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')" t-as="comment_template_top">
|
||||
<div t-out="o.render_comment(comment_template_top, engine='qweb', add_context={my dict}, postprocess=True)" />
|
||||
|
||||
</t>
|
||||
Reference in New Issue
Block a user