Base Comments Templates
base_comment_template · OCA/reporting-engine
base_condition_template (8.0)OCA/account-invoice-reporting 8.0–12.0 → OCA/reporting-engine 13.0–19.0
-
Security22/251 minor finding
-
Activity25/25Last human commit 2 months ago
-
Required by20/252 modules depend on it
-
Maturity25/25In 12 Odoo series since 8.0
Heuristic over the facts below, not an audit · How it's computed
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
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- account_comment_template, l10n_ro_stock_picking_comment_template
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
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
-
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' -
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' -
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)
-
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
-
comment_template_idsMany2many → base.comment.templatecomodel_name='base.comment.template'compute='_compute_comment_template_ids'compute_sudo=Truedomain=<expr>readonly=Falsestore=True
-
render_comment(self, comment, engine=False, add_context=None, options=None)
-
is_comment_templateBooleandefault=Falsehelp='Whether this model supports in reports to add comment templates.'string='Comment Template'
No public methods.
-
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…
Loading…