======================= Base Comments Templates ======================= .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |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/13.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-13-0/reporting-engine-13-0-base_comment_template :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png :target: https://runbot.odoo-community.org/runbot/143/13.0 :alt: Try me on Runbot |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 * ( or without any parameter) This module is the base module for following modules: * sale_comment_template * purchase_comment_template * invoice_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:
You should always use t-if since the method returns False if no template is found. Bug Tracker =========== Bugs are tracked on `GitHub Issues