OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
5.9 KiB

  1. =======================
  2. Base Comments Templates
  3. =======================
  4. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  5. !! This file is generated by oca-gen-addon-readme !!
  6. !! changes will be overwritten. !!
  7. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  8. .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
  9. :target: https://odoo-community.org/page/development-status
  10. :alt: Beta
  11. .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
  12. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  13. :alt: License: AGPL-3
  14. .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
  15. :target: https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template
  16. :alt: OCA/reporting-engine
  17. .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
  18. :target: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template
  19. :alt: Translate me on Weblate
  20. .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
  21. :target: https://runbot.odoo-community.org/runbot/143/14.0
  22. :alt: Try me on Runbot
  23. |badge1| |badge2| |badge3| |badge4| |badge5|
  24. Add a new mixin class to define templates of comments to print on documents.
  25. The comment templates can be defined like make templates, so you can use variables from linked models.
  26. Two positions are available for the comments:
  27. * above document lines (before_lines)
  28. * below document lines (after_lines)
  29. The template are general, and can be attached to any Model and based on some domain defined in the template.
  30. You can define one default template per Model and domain, which can be overwritten for any company and partners.
  31. It has a priority field (smaller number = higher priority)
  32. In existing reports, if you add this line will get the comment template if you created one like
  33. * <span t-raw="o.get_comment_template('position',company_id=o.company_id, partner_id=o.parnter_id )"/> ( or without any parameter)
  34. This module is the base module for following modules:
  35. * sale_comment_template
  36. * purchase_comment_template
  37. * invoice_comment_template
  38. * stock_picking_comment_template
  39. **Table of contents**
  40. .. contents::
  41. :local:
  42. Configuration
  43. =============
  44. Go to *Settings > Technical > Reporting > Comment Templates* and start designing you comment templates.
  45. This module is the base module for following modules:
  46. * sale_comment_template
  47. * purchase_comment_template
  48. * invoice_comment_template
  49. * stock_picking_comment_template
  50. Usage
  51. =====
  52. #. Go to *Settings* and activate the developer mode.
  53. #. Go to *Settings > Technical > Reporting > Comment Templates*.
  54. #. Create a new record.
  55. #. Define the Company the template is linked or leave default for all companies.
  56. #. Define the Partner the template is linked or leave default for all partners.
  57. #. Define the Model, Domain the template is linked.
  58. #. Define the Position where the template will be printed:
  59. * above document lines
  60. * below document lines
  61. You should have at least one template with Default field set, if you choose a Partner the template is deselected as a Default one.
  62. 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.
  63. 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.
  64. Change the report related to the model from configuration and add a statement like:
  65. <p t-if="o.get_comment_template('before_lines', o.company_id.id, o.partner_id and o.partner_id.id or False)">
  66. <span t-raw="o.get_comment_template('before_lines', o.company_id.id, o.partner_id and o.partner_id.id or False)"/>
  67. </p>
  68. <p t-if="o.get_comment_template('after_lines', o.company_id.id, o.partner_id and o.partner_id.id or False)">
  69. <span t-raw="o.get_comment_template('after_lines', o.company_id.id, o.partner_id and o.partner_id.id or False)"/>
  70. </p>
  71. You should always use t-if since the method returns False if no template is found.
  72. Bug Tracker
  73. ===========
  74. Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
  75. In case of trouble, please check there if your issue has already been reported.
  76. If you spotted it first, help us smashing it by providing a detailed and welcomed
  77. `feedback <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**>`_.
  78. Do not contact contributors directly about support or help with technical issues.
  79. Credits
  80. =======
  81. Authors
  82. ~~~~~~~
  83. * Camptocamp
  84. Contributors
  85. ~~~~~~~~~~~~
  86. * Xavier Jimenez <xavier.jimenez@qubiq.es>
  87. * Nicolas Bessi <nicolas.bessi@camptocamp.com>
  88. * Yannick Vaucher <yannick.vaucher@camptocamp.com>
  89. * Guewen Baconnier <guewen.baconnier@camptocamp.com>
  90. * Simone Rubino <simone.rubino@agilebg.com>
  91. * `DynApps <https://www.dynapps.be>`_:
  92. * Raf Ven <raf.ven@dynapps.be>
  93. * `Druidoo <https://www.druidoo.io>`_:
  94. * Iván Todorovich <ivan.todorovich@druidoo.io>
  95. * Pierre Verkest <pierreverkest84@gmail.com>
  96. * `NextERP Romania <https://www.nexterp.ro>`_:
  97. * Fekete Mihai <feketemihai@nexterp.ro>
  98. * `Tecnativa <https://www.tecnativa.com>`_:
  99. * Carlos Roca
  100. * Víctor Martínez
  101. Maintainers
  102. ~~~~~~~~~~~
  103. This module is maintained by the OCA.
  104. .. image:: https://odoo-community.org/logo.png
  105. :alt: Odoo Community Association
  106. :target: https://odoo-community.org
  107. OCA, or the Odoo Community Association, is a nonprofit organization whose
  108. mission is to support the collaborative development of Odoo features and
  109. promote its widespread use.
  110. This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/14.0/base_comment_template>`_ project on GitHub.
  111. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.