Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
31cb7ca
Rename base_condition_template to base_comment_template
Dec 8, 2014
ea1be08
[MIG] base_comment_template to 9.0
Aug 24, 2016
d7cadf7
[MIG] base_comment_template, invoice_comment_template: Migration to 10.0
clb-openfire Jun 19, 2017
b693fa9
[MIG] base_comment_template: Migration to 11.0
xavierjimenez Jul 30, 2018
fbe1c8a
[MIG] base_comment_template: Migration to 12.0
rven Dec 26, 2018
87538fb
Translated using Weblate (Galician)
mvrodriguez Feb 6, 2019
02ca8fb
Translated using Weblate (Japanese)
yostashiro Jul 5, 2019
faf435b
Translated using Weblate (Portuguese)
pedrocs-exo Aug 17, 2019
8a8f4fc
Translated using Weblate (Portuguese (Brazil))
Sep 17, 2019
692a6fa
[IMP] base_comment_template multi company rules
Apr 19, 2019
98e4449
[IMP] account_invoice_comment_template: Move comment_template_id fiel…
Apr 19, 2019
bfd4ea4
[MOV] migration script to base_comment_template
Apr 23, 2019
eb13af6
Translated using Weblate (Portuguese (Brazil))
Nov 24, 2019
f2f1ad9
Translated using Weblate (Portuguese)
pedrocs-exo Feb 29, 2020
a64b0cd
Translated using Weblate (Croatian)
badbole Mar 5, 2020
8f3ffd0
[FIX] base_comment_template: Make field truly company dependent
pedrobaeza Mar 12, 2020
535bf36
[FIX] base_comment_template: Make field truly company dependent
pedrobaeza Mar 12, 2020
886f9a8
Translated using Weblate (German)
marylla Mar 23, 2020
5311610
Translated using Weblate (Portuguese (Portugal))
pedrocs-exo Mar 23, 2020
096babd
Translated using Weblate (Slovak)
jprokop1 Jul 4, 2020
8dccf77
[MIG+FIX] base_comment_template: Fix migration scripts
pedrobaeza Nov 13, 2020
3bed25b
[IMP] base_comment_template: black, isort, prettier
petrus-v Jan 7, 2021
53f9b9e
[MIG] base_comment_template: Migration to 14.0 add unit test
petrus-v Jan 8, 2021
a66632f
[MIG] [13.0] Migrate base_comment_template from account_invoic_report…
feketemihai Jul 8, 2020
f4e9d5e
[IMP] base_comment_template: Code refactorization
Oct 4, 2020
eaa9322
[IMP] base_comment_template: Improved sentences on fields
CarlosRoca13 Feb 9, 2021
6abd2d3
[IMP] base_comment_template: Add function to get_comment_template rec…
victoralmau Apr 8, 2021
6b4e8ed
[FIX] base_comment_template: Fix tests: test_company_general_template
victoralmau Apr 12, 2021
507b410
[FIX] base_comment_template: Change domain in rule according to company
victoralmau Apr 19, 2021
2ac145d
[IMP] base_comment_template: Refactor code and convert to Many2Many
victoralmau Apr 22, 2021
1f0dde7
[FIX] base_comment_template: Incorrect m2m column names + script + av…
pedrobaeza May 15, 2021
5b5bfa8
[IMP] base_comment_template: Adapt to 14.0
victoralmau Apr 13, 2021
8169bff
[FIX] base_comment_template: Filter domain correctly
joao-p-marques May 25, 2021
1acdf21
[FIX] base_comment_template: Delete res_partner.xml view (not used now)
victoralmau May 25, 2021
4e789f7
Translated using Weblate (Portuguese)
pedrocs-exo Jul 1, 2021
bba0c0b
Translated using Weblate (Italian)
francesco-ooops May 9, 2022
dd351ce
[14.0] [FIX] Fix base comment template rendering.
feketemihai Jan 10, 2022
2833c2d
[FIX] base_comment_template: Typo error
etobella Jun 7, 2022
2c3282a
[MIG] base_comment_template: Migration to 15.0
alan196 Apr 26, 2022
c91a6b9
[MIG] base_comment_template: Migration to 15.0
victoralmau Sep 13, 2022
08ce19e
[UPD] Update base_comment_template.pot
Sep 16, 2022
a2509e5
[UPD] README.rst
OCA-git-bot Sep 16, 2022
c73614e
[MIG] base_comment_template : Migration to 16.0
mhachraf Oct 18, 2022
b2c2d00
[UPD] Update base_comment_template.pot
Oct 25, 2022
39dd284
[UPD] README.rst
OCA-git-bot Oct 25, 2022
ada4c84
Update translation files
weblate Oct 25, 2022
8739aad
Translated using Weblate (Spanish (Argentina))
ibuioli Oct 30, 2022
41527c9
Translated using Weblate (German)
marylla Nov 4, 2022
23f489d
[FIX] base_comment_template: Add models text field to prevent error f…
victoralmau Nov 2, 2022
b1435dc
[UPD] Update base_comment_template.pot
Nov 30, 2022
d6f9503
base_comment_template 16.0.2.0.0
OCA-git-bot Nov 30, 2022
011ab03
Update translation files
weblate Nov 30, 2022
9d0423d
Translated using Weblate (Spanish (Argentina))
ibuioli Dec 4, 2022
9766a5c
Translated using Weblate (Italian)
mymage Mar 23, 2023
56595ee
Translated using Weblate (Slovenian)
sysadminmatmoz Apr 11, 2023
95a40c6
Translated using Weblate (Italian)
mymage Jun 14, 2023
69b9ca9
Translated using Weblate (Italian)
francesco-ooops Jul 12, 2023
c41b7e7
[FIX] base_comment_template: search when multiple models in a template
AaronHForgeFlow Jul 19, 2023
26a3a63
base_comment_template 16.0.2.0.1
OCA-git-bot Jul 28, 2023
26f0ab7
[IMP] base_comment_template: allow to show code view in text field
alan196 Aug 21, 2023
1008fc4
[IMP] base_comment_template: allow to select rendering engine in comm…
alan196 Aug 29, 2023
5592cae
Translated using Weblate (Spanish)
Ivorra78 Aug 23, 2023
eb13e9a
[UPD] README.rst
OCA-git-bot Sep 3, 2023
93da93b
[UPD] Update base_comment_template.pot
Sep 3, 2023
dc75ae4
base_comment_template 16.0.2.1.0
OCA-git-bot Sep 3, 2023
7c24b6f
[UPD] README.rst
OCA-git-bot Sep 3, 2023
9dca0ba
Update translation files
weblate Sep 3, 2023
3f4686e
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 4, 2023
5fa80d2
Translated using Weblate (Spanish)
Ivorra78 Sep 7, 2023
0316562
Update translation files
weblate Oct 10, 2023
56f7195
[IMP]base_comment_template: using markup.safe to render html in report
matteonext Dec 20, 2023
0845506
[BOT] post-merge updates
OCA-git-bot Dec 27, 2023
85be887
Translated using Weblate (Italian)
mymage Dec 28, 2023
b1b6393
[BOT] post-merge updates
OCA-git-bot Jan 11, 2024
abdd14f
Translated using Weblate (Italian)
mymage Jan 18, 2024
9383de1
[IMP] base_comment_template: update readme files
alan196 Aug 22, 2023
9ee51c5
[BOT] post-merge updates
OCA-git-bot May 3, 2024
a56281e
[IMP] base_comment_template: pre-commit auto fixes
alan196 May 3, 2024
849e346
[MIG] base_comment_template: Migration to 17.0
alan196 May 3, 2024
8aa0d1d
[UPD] Update base_comment_template.pot
Jul 23, 2024
abce334
[BOT] post-merge updates
OCA-git-bot Jul 23, 2024
fdeb52a
Update translation files
weblate Jul 23, 2024
45d53e3
Translated using Weblate (Italian)
mymage Jul 24, 2024
22794f5
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 16, 2024
62ad958
[IMP] base_comment_template: pre-commit auto fixes
yankinmax Jan 8, 2025
39643cb
[MIG] base_comment_template: Migration to 18.0
yankinmax Jan 8, 2025
f1d7357
[UPD] Update base_comment_template.pot
Jan 15, 2025
9a4a907
[BOT] post-merge updates
OCA-git-bot Jan 15, 2025
f0a179c
Update translation files
weblate Jan 15, 2025
f7a39cb
base_comment_template: replace old tree node by list node
Ricardoalso Feb 26, 2025
9a54067
[BOT] post-merge updates
OCA-git-bot Feb 26, 2025
40ed77e
[IMP] base_comment_template: Allow creation of global templates
etobella Jun 12, 2025
a9afecf
Translated using Weblate (Turkish)
tsezgin Sep 15, 2025
aa74312
[UPD] Update base_comment_template.pot
Oct 31, 2025
78b0232
[BOT] post-merge updates
OCA-git-bot Oct 31, 2025
cccfc5a
Update translation files
weblate Oct 31, 2025
d50e587
Translated using Weblate (Italian)
mymage Nov 3, 2025
a87e3a4
Translated using Weblate (Catalan)
RicardCForgeFlow Dec 9, 2025
2c90775
[MIG] base_comment_template: Migration to 19.0
feketemihai Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 208 additions & 0 deletions base_comment_template/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Base Comments Templates
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fceb79cbad33f077c558feebc3fe3feb103dbb2f6d8d51c6548c301ebf07b4a9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/19.0/base_comment_template
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-19-0/reporting-engine-19-0-base_comment_template
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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

**Table of contents**

.. contents::
:local:

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:

| <t t-foreach="o.comment_template_ids.filtered(lambda x: x.position ==
'before_lines')" t-as="comment_template_top">
| <div t-out="o.render_comment(comment_template_top)" />

</t>

| <t t-foreach="o.comment_template_ids.filtered(lambda x: x.position ==
'after_lines')" t-as="comment_template_bottom">
| <div t-out="o.render_comment(comment_template_bottom)" />

</t>

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 :

| <t t-foreach="o.comment_template_ids.filtered(lambda x: x.position ==
'before_lines')" t-as="comment_template_top">
| <div t-out="o.render_comment(comment_template_top, engine='qweb',
add_context={my dict}, postprocess=True)" />

</t>

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/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 <https://github.com/OCA/reporting-engine/issues/new?body=module:%20base_comment_template%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Camptocamp

Contributors
------------

- Xavier Jimenez <[email protected]>
- Nicolas Bessi <[email protected]>
- Yannick Vaucher <[email protected]>
- Guewen Baconnier <[email protected]>
- Simone Rubino <[email protected]>
- `DynApps <https://www.dynapps.be>`__:

- Raf Ven <[email protected]>

- `Druidoo <https://www.druidoo.io>`__:

- Iván Todorovich <[email protected]>

- Pierre Verkest <[email protected]>
- `NextERP Romania <https://www.nexterp.ro>`__:

- Fekete Mihai <[email protected]>

- `Tecnativa <https://www.tecnativa.com>`__:

- Carlos Roca
- Víctor Martínez

- `Jarsa <https://www.jarsa.com>`__:

- Alan Ramos <[email protected]>

- `Bloopark systems <https://www.bloopark.de/>`__:

- Achraf Mhadhbi <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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 <https://github.com/OCA/reporting-engine/tree/19.0/base_comment_template>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions base_comment_template/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from . import wizard
22 changes: 22 additions & 0 deletions base_comment_template/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# © 2013-2014 Nicolas Bessi (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Base Comments Templates",
"summary": "Add conditional mako template to any report"
"on models that inherits comment.template.",
"version": "19.0.0.0.0",
"category": "Reporting",
"website": "https://github.com/OCA/reporting-engine",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["base", "mail"],
"data": [
"security/ir.model.access.csv",
"security/security.xml",
"wizard/base_comment_template_preview_views.xml",
"views/base_comment_template_view.xml",
"views/res_partner_view.xml",
],
}
Loading