odoo-addon-base-comment-template


Nameodoo-addon-base-comment-template JSON
Version 16.0.2.2.2 PyPI version JSON
download
home_pagehttps://github.com/OCA/reporting-engine
SummaryAdd conditional mako template to any reporton models that inherits comment.template.
upload_time2024-05-03 15:41:45
maintainerNone
docs_urlNone
authorCamptocamp, Odoo Community Association (OCA)
requires_python>=3.10
licenseAGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======================
Base Comments Templates
=======================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:72251979ce578742037aa71ca933ba9c4ed9951b7e3f68951ca232766f72d000
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
    :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
    :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
    :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
    :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.

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

**Table of contents**

.. contents::
   :local:

Configuration
=============

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

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:

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

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/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 <https://github.com/OCA/reporting-engine/issues/new?body=module:%20base_comment_template%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Camptocamp

Contributors
~~~~~~~~~~~~

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

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

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 <https://github.com/OCA/reporting-engine/tree/16.0/base_comment_template>`_ project on GitHub.

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



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OCA/reporting-engine",
    "name": "odoo-addon-base-comment-template",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Camptocamp, Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": null,
    "platform": null,
    "description": "=======================\nBase Comments Templates\n=======================\n\n.. \n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! This file is generated by oca-gen-addon-readme !!\n   !! changes will be overwritten.                   !!\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! source digest: sha256:72251979ce578742037aa71ca933ba9c4ed9951b7e3f68951ca232766f72d000\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n    :target: https://odoo-community.org/page/development-status\n    :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png\n    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html\n    :alt: License: AGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github\n    :target: https://github.com/OCA/reporting-engine/tree/16.0/base_comment_template\n    :alt: OCA/reporting-engine\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n    :target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-base_comment_template\n    :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png\n    :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0\n    :alt: Try me on Runboat\n\n|badge1| |badge2| |badge3| |badge4| |badge5|\n\nAdd a new mixin class to define templates of comments to print on documents.\nThe comment templates can be defined like make templates, so you can use variables from linked models.\n\nTwo positions are available for the comments:\n\n* above document lines (before_lines)\n* below document lines (after_lines)\n\nThe template are general, and can be attached to any Model and based on some domain defined in the template.\nYou can define one default template per Model and domain, which can be overwritten for any company and partners.\nIt has a priority field (smaller number = higher priority)\n\nIn existing reports, if you add this line will get the comment template if you created one like\n\n* <span t-out=\"o.get_comment_template('position',company_id=o.company_id, partner_id=o.parnter_id )\"/> ( or without any parameter)\n\n\nThis module is the base module for following modules:\n\n* sale_comment_template\n* purchase_comment_template\n* account_comment_template\n* stock_picking_comment_template\n\n**Table of contents**\n\n.. contents::\n   :local:\n\nConfiguration\n=============\n\nGo to *Settings > Technical > Reporting > Comment Templates* and start designing you comment templates.\n\nThis module is the base module for following modules:\n\n* sale_comment_template\n* purchase_comment_template\n* invoice_comment_template\n* stock_picking_comment_template\n\nUsage\n=====\n\n#. Go to *Settings* and activate the developer mode.\n#. Go to *Settings > Technical > Reporting > Comment Templates*.\n#. Create a new record.\n#. Define the Company the template is linked or leave default for all companies.\n#. Define the Partner the template is linked or leave default for all partners.\n#. Define the Model, Domain the template is linked.\n#. Define the Position where the template will be printed:\n\n   * above document lines\n   * below document lines\n\nYou should have at least one template with Default field set, if you choose a Partner the template is deselected as a Default one.\nIf 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.\n\nThe 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.\n\nChange the report related to the model from configuration and add a statement like:\n\n<t t-foreach=\"o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')\" t-as=\"comment_template_top\">\n  <div t-out=\"o.render_comment(comment_template_top)\" />\n\n</t>\n\n\n<t t-foreach=\"o.comment_template_ids.filtered(lambda x: x.position == 'after_lines')\" t-as=\"comment_template_bottom\">\n    <div t-out=\"o.render_comment(comment_template_bottom)\" />\n\n</t>\n\nYou should always use t-if since the method returns False if no template is found.\n\nIf you want to use Qweb templates, or different context, you can specify it just like in\nmail.render.mixin with parameters:\n\n- engine: \"inline_template\", \"qweb\" or \"qweb_view\",\n- add_context: dict with your own context,\n- post_process: perform a post processing on rendered result\n\nso you could use it :\n\n<t t-foreach=\"o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')\" t-as=\"comment_template_top\">\n    <div t-out=\"o.render_comment(comment_template_top, engine='qweb', add_context={my dict}, postprocess=True)\" />\n\n</t>\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20base_comment_template%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n~~~~~~~\n\n* Camptocamp\n\nContributors\n~~~~~~~~~~~~\n\n* Xavier Jimenez <xavier.jimenez@qubiq.es>\n* Nicolas Bessi <nicolas.bessi@camptocamp.com>\n* Yannick Vaucher <yannick.vaucher@camptocamp.com>\n* Guewen Baconnier <guewen.baconnier@camptocamp.com>\n* Simone Rubino <simone.rubino@agilebg.com>\n* `DynApps <https://www.dynapps.be>`_:\n\n  * Raf Ven <raf.ven@dynapps.be>\n\n* `Druidoo <https://www.druidoo.io>`_:\n\n  * Iv\u00e1n Todorovich <ivan.todorovich@druidoo.io>\n* Pierre Verkest <pierreverkest84@gmail.com>\n\n* `NextERP Romania <https://www.nexterp.ro>`_:\n\n  * Fekete Mihai <feketemihai@nexterp.ro>\n\n* `Tecnativa <https://www.tecnativa.com>`_:\n\n  * Carlos Roca\n  * V\u00edctor Mart\u00ednez\n\n* `Jarsa <https://www.jarsa.com>`_:\n\n  * Alan Ramos <alan.ramos@jarsa.com>\n\n* `Bloopark systems <https://www.bloopark.de/>`_:\n\n  * Achraf Mhadhbi <machraf@bloopark.de>\n\nMaintainers\n~~~~~~~~~~~\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\nThis module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/16.0/base_comment_template>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n\n\n",
    "bugtrack_url": null,
    "license": "AGPL-3",
    "summary": "Add conditional mako template to any reporton models that inherits comment.template.",
    "version": "16.0.2.2.2",
    "project_urls": {
        "Homepage": "https://github.com/OCA/reporting-engine"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c7d6cbe6bbac7824c8fd8adf3afff365e278af4429694c6e18ab707af92ead4f",
                "md5": "5cf09a7f7bce22c6a2d9f549d9358edc",
                "sha256": "a3f557a3566599a60063836446c17f54bee3e6a0a05dc42dfd4b1d8b8d4d54aa"
            },
            "downloads": -1,
            "filename": "odoo_addon_base_comment_template-16.0.2.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5cf09a7f7bce22c6a2d9f549d9358edc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 186927,
            "upload_time": "2024-05-03T15:41:45",
            "upload_time_iso_8601": "2024-05-03T15:41:45.503546Z",
            "url": "https://files.pythonhosted.org/packages/c7/d6/cbe6bbac7824c8fd8adf3afff365e278af4429694c6e18ab707af92ead4f/odoo_addon_base_comment_template-16.0.2.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-03 15:41:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OCA",
    "github_project": "reporting-engine",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "odoo-addon-base-comment-template"
}
        
Elapsed time: 0.25467s