Base Comments Templates
(0)
237

Base Comments Templates

FREE

Available versions
Required apps
Discuss (mail)
Technical name
base_comment_template
License
AGPL-3
Secure dependencies
N/A
Base Comments Templates

Base Comments Templates

Mature 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

  • <span t-raw=”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
  • invoice_comment_template
  • stock_picking_comment_template

Table of contents

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

  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:

<p t-if=”o.get_comment_template(‘before_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”>

<span t-raw=”o.get_comment_template(‘before_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”/>

</p>

<p t-if=”o.get_comment_template(‘after_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”>

<span t-raw=”o.get_comment_template(‘after_lines’, o.company_id.id, o.partner_id and o.partner_id.id or False)”/>

</p>

You should always use t-if since the method returns False if no template is found.

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.

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

Credits

Authors

  • Camptocamp

Contributors

Maintainers

This module is maintained by the OCA.

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.

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

0.0 / 5.0
based on 0 ratings

Python dependencies

Package Version Secured
openupgradelib 3.6.1
This app has automated tests.

Available languages

Language % translated
Croatian / hrvatski jezik
38%
Portuguese / Português
38%
Portuguese (BR) / Português (BR)
38%
French / Français
27%
Slovenian / slovenščina
27%
German / Deutsch
27%
Japanese / 日本語
27%
Dutch / Nederlands
22%
Italian / Italiano
22%
Turkish / Türkçe
19%
English (UK)
19%
Vietnamese / Tiếng Việt
19%
Slovak / Slovenský jazyk
19%
Thai / ภาษาไทย
19%
Chinese (Simplified) / 简体中文
19%
Spanish / Español
19%
Persian / فارس
19%
Indonesian / Bahasa Indonesia
19%
Bosnian / bosanski jezik
19%
Spanish (MX) / Español (MX)
19%
Polish / Język polski
19%
Bulgarian / български език
19%
Mongolian / монгол
19%
Dutch / Nederlands
19%
Spanish (DO) / Español (DO)
19%
Serbian (Latin) / srpski
19%
Arabic / الْعَرَبيّة
19%
Portuguese / Português
19%
Spanish (CL) / Español (CL)
19%
Hungarian / Magyar
19%
Dutch (BE) / Nederlands (BE)
19%
Norwegian Bokmål / Norsk bokmål
19%
Estonian / Eesti keel
19%
Spanish (CO) / Español (CO)
19%
Chinese (Traditional) / 繁體中文
19%
Spanish (EC) / Español (EC)
19%
Spanish (AR) / Español (AR)
19%
Romanian / română
19%
Croatian / hrvatski jezik
19%
Spanish / Español
19%
Turkish / Türkçe
19%
Finnish / Suomi
19%
French (CH) / Français (CH)
19%
Ukrainian / українська
19%
Spanish (VE) / Español (VE)
19%
Spanish (PE) / Español (PE)
19%
Swedish / Svenska
19%
Macedonian / македонски јазик
19%
Hebrew / עִבְרִי
19%
French (CA) / Français (CA)
16%
Lithuanian / Lietuvių kalba
13%
Spanish (CR) / Español (CR)
13%
Lithuanian / Lietuvių kalba
13%
Greek / Ελληνικά
13%
Latvian / latviešu valoda
13%
Spanish (PY) / Español (PY)
13%
Vietnamese / Tiếng Việt
13%
Russian / русский язык
13%
Galician / Galego
2%
Galician / Galego
2%