OdooWiki OCA HUB

Base Comments Templates

base_comment_template folder_open OCA/reporting-engine open_in_new
Reporting License: AGPL-3

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

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Create reusable comment templates that can be printed on documents and reports, with rules deciding which template appears for which company, partner or record.

This module adds a new kind of record called a comment template. Each template has a name, a rich-text body, and a position telling whether the comment should appear at the top or the bottom of a document.

  • Templates are managed from a new "Comment Templates" menu under the technical Reporting menu, where you can create, archive and reorder them.
  • For each template you choose the models it applies to, a filter condition, a priority, and optionally a company or specific partners. A template can also be marked as global so it is available everywhere.
  • A Preview button opens a wizard where you pick an example record, a language and a rendering engine to see exactly what the comment will look like before using it.
  • On a contact form, a new "Comment Templates" tab lets you attach specific templates to that partner; these are treated as commercial fields, so they follow the company hierarchy.
  • Documents that support comments automatically receive the matching templates based on the model, the filter condition, the partner and the company, and the comment text can include values taken from the document itself.
  • A multi-company rule limits which templates each company can see.

This is a foundation module: it provides the mechanism, while the actual printing on sales, purchases, invoices or deliveries is added by related modules.

Depends on

basemail

Menus it adds

Comment Templates
Models and fields (5)
  • ir.model · extends an existing modelis_comment_template (Comment Template)
  • res.partner · extends an existing modelbase_comment_template_ids (Comment Templates)
  • comment.template · new modelcomment_template_ids
  • base.comment.template · new modelname, text (Template), active, domain (Filter Domain), engine, models, position (Position on document), sequence, model_ids (IR Model), company_id, partner_ids, global_template
  • base.comment.template.preview · new modelbody, lang (Template Preview Language), engine (Template Preview Engine), model_id, model_ids, no_record, resource_ref (Record reference), base_comment_template_id

Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 8 confirmed, 1 with no information of 9 versions.

Sources · Odoo 14.0

Confirmed on 2026-11-03 in branch 14.0 of OCA/reporting-engine.

terminal Installation and usage

OCA documentation · Odoo 19.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
  • 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 :

\ \

\

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.