TIP: You can type at any time to perform a new search.
Base Comments Templates
base_comment_template · OCA/reporting-engine
- 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
- 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 ID | Name | Model | Type | Status |
|---|---|---|---|---|
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)
-
activeBooleandefault=True -
company_idMany2one → res.companycomodel_name='res.company'help='If set, the comment template will be available only for the selected company.'index=Trueondelete='cascade'string='Company' -
domainChardefault='[]'help='This comment template will be available only for objects that satisfy the condition'required=Truestring='Filter Domain' -
engineSelectiondefault='inline_template'help='This field allows to select the engine to use for rendering the template.'required=Trueselection=[('inline_template', 'Inline Template'), ('qweb', 'QWeb'), ('qweb_view', 'QWeb View')] -
global_templateBoolean -
model_idsMany2many → ir.modelcomodel_name='ir.model'compute='_compute_model_ids'compute_sudo=Truehelp='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' -
modelsTextrequired=True -
nameCharhelp='Name/description of this comment template'required=Truetranslate=True -
partner_idsMany2many → res.partnercolumn1='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' -
positionSelectiondefault='before_lines'help='This field allows to select the position of the comment on reports.'required=Trueselection=[('before_lines', 'Top'), ('after_lines', 'Bottom')]string='Position on document' -
sequenceIntegerdefault=10help='The smaller number = The higher priority'required=True -
textHtmlhelp='This is the text template that will be inserted into reports.'required=Truesanitize=Falsestring='Template'translate=True
-
check_models(self)@api.constrains('models')Avoid non-existing or not allowed models (is_comment_template=True)
New fields (8)
-
base_comment_template_idMany2one → base.comment.templateondelete='cascade'required=True args: 'base.comment.template' -
bodyCharcompute='_compute_base_comment_template_fields' -
engineSelectiondefault='inline_template'string='Template Preview Engine' args: [('inline_template', 'Inline template'), ('qweb', 'QWeb'), ('qweb_view', 'QWeb view')] -
langSelectionstring='Template Preview Language' args: _lang_get -
model_idMany2one → ir.modelargs: 'ir.model' -
model_idsMany2many → ir.modelrelated='base_comment_template_id.model_ids' args: 'ir.model' -
no_recordBooleancompute='_compute_no_record' -
resource_refReferenceselection='_selection_target_model'string='Record reference'
-
default_get(self, fields)@api.model
New fields (1)
-
comment_template_idsMany2many → base.comment.templatecomodel_name='base.comment.template'compute='_compute_comment_template_ids'compute_sudo=Truedomain=<expr>readonly=Falsestore=Truestring='Comment Template'
-
render_comment(self, comment, engine=False, add_context=None, options=None)
New fields (1)
-
is_comment_templateBooleandefault=Falsehelp='Whether this model supports in reports to add comment templates.'string='Comment Template'
No public methods.
New fields (1)
-
base_comment_template_idsMany2many → base.comment.templatecolumn1='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'
No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…