From 7234782c242a8dcfd6090763e017a2c72bb1f1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Alan=20Ramos=20Rodri=CC=81guez?= Date: Fri, 3 May 2024 10:00:37 -0600 Subject: [PATCH] [IMP] base_comment_template: pre-commit auto fixes --- base_comment_template/README.rst | 161 ++++++++++-------- base_comment_template/pyproject.toml | 3 + base_comment_template/readme/CONFIGURE.md | 9 + base_comment_template/readme/CONFIGURE.rst | 8 - base_comment_template/readme/CONTRIBUTORS.md | 19 +++ base_comment_template/readme/CONTRIBUTORS.rst | 30 ---- base_comment_template/readme/DESCRIPTION.md | 27 +++ base_comment_template/readme/DESCRIPTION.rst | 23 --- base_comment_template/readme/USAGE.md | 52 ++++++ base_comment_template/readme/USAGE.rst | 44 ----- .../static/description/index.html | 94 ++++++---- 11 files changed, 257 insertions(+), 213 deletions(-) create mode 100644 base_comment_template/pyproject.toml create mode 100644 base_comment_template/readme/CONFIGURE.md delete mode 100644 base_comment_template/readme/CONFIGURE.rst create mode 100644 base_comment_template/readme/CONTRIBUTORS.md delete mode 100644 base_comment_template/readme/CONTRIBUTORS.rst create mode 100644 base_comment_template/readme/DESCRIPTION.md delete mode 100644 base_comment_template/readme/DESCRIPTION.rst create mode 100644 base_comment_template/readme/USAGE.md delete mode 100644 base_comment_template/readme/USAGE.rst diff --git a/base_comment_template/README.rst b/base_comment_template/README.rst index 099cd2facf..9caf8adc98 100644 --- a/base_comment_template/README.rst +++ b/base_comment_template/README.rst @@ -17,40 +17,44 @@ Base Comments Templates :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github - :target: https://github.com/OCA/reporting-engine/tree/16.0/base_comment_template + :target: https://github.com/OCA/reporting-engine/tree/17.0/base_comment_template :alt: OCA/reporting-engine .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-base_comment_template + :target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-base_comment_template :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -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. +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) +- 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) +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 - -* ( or without any parameter) +In existing reports, if you add this line will get the comment template +if you created one like +- ( 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 +- sale_comment_template +- purchase_comment_template +- account_comment_template +- stock_picking_comment_template **Table of contents** @@ -60,60 +64,73 @@ This module is the base module for following modules: Configuration ============= -Go to *Settings > Technical > Reporting > Comment Templates* and start designing you comment templates. +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 +- sale_comment_template +- purchase_comment_template +- invoice_comment_template +- stock_picking_comment_template Usage ===== -#. 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: +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 + - 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. +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. +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: +Change the report related to the model from configuration and add a +statement like: - -
+| +|
- - -
+| +|
-You should always use t-if since the method returns False if no template is found. +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: +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 +- 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 : - -
+| +|
@@ -123,7 +140,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -131,46 +148,46 @@ Credits ======= Authors -~~~~~~~ +------- * Camptocamp Contributors -~~~~~~~~~~~~ +------------ -* Xavier Jimenez -* Nicolas Bessi -* Yannick Vaucher -* Guewen Baconnier -* Simone Rubino -* `DynApps `_: +- Xavier Jimenez +- Nicolas Bessi +- Yannick Vaucher +- Guewen Baconnier +- Simone Rubino +- `DynApps `__: - * Raf Ven + - Raf Ven -* `Druidoo `_: +- `Druidoo `__: - * Iván Todorovich -* Pierre Verkest + - Iván Todorovich -* `NextERP Romania `_: +- Pierre Verkest +- `NextERP Romania `__: - * Fekete Mihai + - Fekete Mihai -* `Tecnativa `_: +- `Tecnativa `__: - * Carlos Roca - * Víctor Martínez + - Carlos Roca + - Víctor Martínez -* `Jarsa `_: +- `Jarsa `__: - * Alan Ramos + - Alan Ramos -* `Bloopark systems `_: +- `Bloopark systems `__: - * Achraf Mhadhbi + - Achraf Mhadhbi Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -182,6 +199,6 @@ 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. -This module is part of the `OCA/reporting-engine `_ project on GitHub. +This module is part of the `OCA/reporting-engine `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/base_comment_template/pyproject.toml b/base_comment_template/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/base_comment_template/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/base_comment_template/readme/CONFIGURE.md b/base_comment_template/readme/CONFIGURE.md new file mode 100644 index 0000000000..2270640ae7 --- /dev/null +++ b/base_comment_template/readme/CONFIGURE.md @@ -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 diff --git a/base_comment_template/readme/CONFIGURE.rst b/base_comment_template/readme/CONFIGURE.rst deleted file mode 100644 index aa45ae16b9..0000000000 --- a/base_comment_template/readme/CONFIGURE.rst +++ /dev/null @@ -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 diff --git a/base_comment_template/readme/CONTRIBUTORS.md b/base_comment_template/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..d132fae14b --- /dev/null +++ b/base_comment_template/readme/CONTRIBUTORS.md @@ -0,0 +1,19 @@ +- Xavier Jimenez \<\> +- Nicolas Bessi \<\> +- Yannick Vaucher \<\> +- Guewen Baconnier \<\> +- Simone Rubino \<\> +- [DynApps](https://www.dynapps.be): + - Raf Ven \<\> +- [Druidoo](https://www.druidoo.io): + - Iván Todorovich \<\> +- Pierre Verkest \<\> +- [NextERP Romania](https://www.nexterp.ro): + - Fekete Mihai \<\> +- [Tecnativa](https://www.tecnativa.com): + - Carlos Roca + - Víctor Martínez +- [Jarsa](https://www.jarsa.com): + - Alan Ramos \<\> +- [Bloopark systems](https://www.bloopark.de/): + - Achraf Mhadhbi \<\> diff --git a/base_comment_template/readme/CONTRIBUTORS.rst b/base_comment_template/readme/CONTRIBUTORS.rst deleted file mode 100644 index b30c0edb19..0000000000 --- a/base_comment_template/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,30 +0,0 @@ -* Xavier Jimenez -* Nicolas Bessi -* Yannick Vaucher -* Guewen Baconnier -* Simone Rubino -* `DynApps `_: - - * Raf Ven - -* `Druidoo `_: - - * Iván Todorovich -* Pierre Verkest - -* `NextERP Romania `_: - - * Fekete Mihai - -* `Tecnativa `_: - - * Carlos Roca - * Víctor Martínez - -* `Jarsa `_: - - * Alan Ramos - -* `Bloopark systems `_: - - * Achraf Mhadhbi diff --git a/base_comment_template/readme/DESCRIPTION.md b/base_comment_template/readme/DESCRIPTION.md new file mode 100644 index 0000000000..9a9d073ddf --- /dev/null +++ b/base_comment_template/readme/DESCRIPTION.md @@ -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 + +- \ ( 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 diff --git a/base_comment_template/readme/DESCRIPTION.rst b/base_comment_template/readme/DESCRIPTION.rst deleted file mode 100644 index bd616e27f9..0000000000 --- a/base_comment_template/readme/DESCRIPTION.rst +++ /dev/null @@ -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 - -* ( 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 diff --git a/base_comment_template/readme/USAGE.md b/base_comment_template/readme/USAGE.md new file mode 100644 index 0000000000..8792b757a8 --- /dev/null +++ b/base_comment_template/readme/USAGE.md @@ -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: + +\ +\
+ +\ + +\ +\
+ +\ + +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 : + +\ +\
+ +\ diff --git a/base_comment_template/readme/USAGE.rst b/base_comment_template/readme/USAGE.rst deleted file mode 100644 index 30343d7ae3..0000000000 --- a/base_comment_template/readme/USAGE.rst +++ /dev/null @@ -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: - - -
- - - - - -
- - - -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 : - - -
- - diff --git a/base_comment_template/static/description/index.html b/base_comment_template/static/description/index.html index 04b9ea8514..487b5e8f01 100644 --- a/base_comment_template/static/description/index.html +++ b/base_comment_template/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,20 +369,25 @@

Base Comments Templates

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:72251979ce578742037aa71ca933ba9c4ed9951b7e3f68951ca232766f72d000 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

-

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.

+

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

+

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

+

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)
  • +
  • <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:

    @@ -406,7 +412,8 @@

    Base Comments Templates

Configuration

-

Go to Settings > Technical > Reporting > Comment Templates and start designing you comment templates.

+

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
  • @@ -421,8 +428,10 @@

    Usage

  • 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 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
    • @@ -430,33 +439,44 @@

      Usage

  • -

    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)” />
    -
    +

    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 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:

    +

    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 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>

@@ -464,7 +484,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -514,11 +534,13 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.

-

This module is part of the OCA/reporting-engine project on GitHub.

+

This module is part of the OCA/reporting-engine project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.