Repository
OCA/reporting-engine · module folder · Try on Runboat
Module version
0.0.1
Category
Reporting
Folder size
0.99 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/reporting-engine
Last tracking update
2026-08-07 09:06:34
Authors
Camptocamp, Odoo Community Association (OCA)
Maintainers
Camptocamp, Odoo Community Association (OCA)
Committers
Mihai Fekete, Weblate, OCA-git-bot, oca-ci, Asta
Odoo dependencies
odoo/odoo:
- web
- bus
Python dependencies
None
System dependencies
None
Required by
account_comment_template, l10n_ro_stock_picking_comment_template
Description
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

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
base_comment_template_preview_form base.comment.template.preview.form base.comment.template.preview form New
view_base_comment_template_form base.comment.template.form base.comment.template form New
view_base_comment_template_search base.comment.template.search base.comment.template search New
view_base_comment_template_tree base.comment.template.search base.comment.template list New
view_partner_form res.partner form Inherits base.view_partner_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (5)

New fields (12)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    comodel_name='res.company' help='If set, the comment template will be available only for the selected company.' index=True ondelete='cascade' string='Company'
  • domain Char
    default='[]' help='This comment template will be available only for objects that satisfy the condition' required=True string='Filter Domain'
  • engine Selection
    default='inline_template' help='This field allows to select the engine to use for rendering the template.' required=True selection=[('inline_template', 'Inline Template'), ('qweb', 'QWeb'), ('qweb_view', 'QWeb View')]
  • global_template Boolean
  • model_ids Many2many → ir.model
    comodel_name='ir.model' compute='_compute_model_ids' compute_sudo=True help='This comment template will be available on this models. You can see here only models allowed to set the coment template.' search='_search_model_ids' string='IR Model'
  • models Text
    required=True
  • name Char
    help='Name/description of this comment template' required=True translate=True
  • partner_ids Many2many → res.partner
    column1='base_comment_template_id' column2='res_partner_id' comodel_name='res.partner' help='If set, the comment template will be available only for the selected partner.' relation='base_comment_template_res_partner_rel' string='Partner'
  • position Selection
    default='before_lines' help='This field allows to select the position of the comment on reports.' required=True selection=[('before_lines', 'Top'), ('after_lines', 'Bottom')] string='Position on document'
  • sequence Integer
    default=10 help='The smaller number = The higher priority' required=True
  • text Html
    help='This is the text template that will be inserted into reports.' required=True sanitize=False string='Template' translate=True
Public methods (1)
  • check_models(self)
    @api.constrains('models')
    Avoid non-existing or not allowed models (is_comment_template=True)

New fields (8)
  • base_comment_template_id Many2one → base.comment.template
    ondelete='cascade' required=True args: 'base.comment.template'
  • body Char
    compute='_compute_base_comment_template_fields'
  • engine Selection
    default='inline_template' string='Template Preview Engine' args: [('inline_template', 'Inline template'), ('qweb', 'QWeb'), ('qweb_view', 'QWeb view')]
  • lang Selection
    string='Template Preview Language' args: _lang_get
  • model_id Many2one → ir.model
    args: 'ir.model'
  • model_ids Many2many → ir.model
    related='base_comment_template_id.model_ids' args: 'ir.model'
  • no_record Boolean
    compute='_compute_no_record'
  • resource_ref Reference
    selection='_selection_target_model' string='Record reference'
Public methods (1)
  • default_get(self, fields)
    @api.model

New fields (1)
  • comment_template_ids Many2many → base.comment.template
    comodel_name='base.comment.template' compute='_compute_comment_template_ids' compute_sudo=True domain=<expr> readonly=False store=True string='Comment Template'
Public methods (1)
  • render_comment(self, comment, engine=False, add_context=None, options=None)

New fields (1)
  • is_comment_template Boolean
    default=False help='Whether this model supports in reports to add comment templates.' string='Comment Template'
Public methods (0)

No public methods.

New fields (1)
  • base_comment_template_ids Many2many → base.comment.template
    column1='res_partner_id' column2='base_comment_template_id' comodel_name='base.comment.template' domain=[('global_template', '=', False)] help='Specific partner comments that can be included in reports' relation='base_comment_template_res_partner_rel' string='Comment Templates'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…