Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] base_comment_template #876

Merged
merged 79 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
edb98ae
Rename base_condition_template to base_comment_template
guewen Dec 8, 2014
cb8d66f
[MIG] base_comment_template to 9.0
Aug 24, 2016
f603b9f
[MIG] base_comment_template, invoice_comment_template: Migration to 10.0
clb-openfire Jun 19, 2017
ad18d1d
[MIG] base_comment_template: Migration to 11.0
xavierjimenez Jul 30, 2018
b984c11
[MIG] base_comment_template: Migration to 12.0
rven Dec 26, 2018
c682bc4
Translated using Weblate (Galician)
mvrodriguez Feb 6, 2019
9180387
Translated using Weblate (Japanese)
yostashiro Jul 5, 2019
33007a9
Translated using Weblate (Portuguese)
pedrocasi Aug 17, 2019
4e960f3
Translated using Weblate (Portuguese (Brazil))
Sep 17, 2019
1324c58
[IMP] base_comment_template multi company rules
Apr 19, 2019
d35307e
[IMP] account_invoice_comment_template: Move comment_template_id fiel…
Apr 19, 2019
02af0d6
[MOV] migration script to base_comment_template
Apr 23, 2019
e994263
Translated using Weblate (Portuguese (Brazil))
Nov 24, 2019
fd2fb11
Translated using Weblate (Portuguese)
pedrocasi Feb 29, 2020
2f921f1
Translated using Weblate (Croatian)
badbole Mar 5, 2020
0610dc3
[FIX] base_comment_template: Make field truly company dependent
pedrobaeza Mar 12, 2020
c8af2bb
[FIX] base_comment_template: Make field truly company dependent
pedrobaeza Mar 12, 2020
e5ddb8e
Translated using Weblate (German)
marylla Mar 23, 2020
61f9bfa
Translated using Weblate (Portuguese (Portugal))
pedrocasi Mar 23, 2020
c2fa5eb
Translated using Weblate (Slovak)
jprokop1 Jul 4, 2020
7f1701c
[MIG+FIX] base_comment_template: Fix migration scripts
pedrobaeza Nov 13, 2020
fa2a677
[IMP] base_comment_template: black, isort, prettier
petrus-v Jan 7, 2021
2b3dce5
[MIG] base_comment_template: Migration to 14.0 add unit test
petrus-v Jan 8, 2021
9daf0f6
[MIG] [13.0] Migrate base_comment_template from account_invoic_report…
feketemihai Jul 8, 2020
f47b821
[IMP] base_comment_template: Code refactorization
Oct 4, 2020
2dfe6cc
[IMP] base_comment_template: Improved sentences on fields
CarlosRoca13 Feb 9, 2021
0d8cdef
[IMP] base_comment_template: Add function to get_comment_template rec…
victoralmau Apr 8, 2021
6c63370
[FIX] base_comment_template: Fix tests: test_company_general_template
victoralmau Apr 12, 2021
ea64cd2
[FIX] base_comment_template: Change domain in rule according to company
victoralmau Apr 19, 2021
29842b1
[IMP] base_comment_template: Refactor code and convert to Many2Many
victoralmau Apr 22, 2021
010f33c
[FIX] base_comment_template: Incorrect m2m column names + script + av…
pedrobaeza May 15, 2021
fafb9fb
[IMP] base_comment_template: Adapt to 14.0
victoralmau Apr 13, 2021
aa72fde
[FIX] base_comment_template: Filter domain correctly
joao-p-marques May 25, 2021
3627bee
[FIX] base_comment_template: Delete res_partner.xml view (not used now)
victoralmau May 25, 2021
acb9bca
Translated using Weblate (Portuguese)
pedrocasi Jul 1, 2021
34c1ec8
Translated using Weblate (Italian)
francesco-ooops May 9, 2022
e4f6582
[14.0] [FIX] Fix base comment template rendering.
feketemihai Jan 10, 2022
b0d5436
[FIX] base_comment_template: Typo error
etobella Jun 7, 2022
6197324
[MIG] base_comment_template: Migration to 15.0
alan196 Apr 26, 2022
1a9d317
[MIG] base_comment_template: Migration to 15.0
victoralmau Sep 13, 2022
9d6d94a
[UPD] Update base_comment_template.pot
Sep 16, 2022
dd58092
[UPD] README.rst
OCA-git-bot Sep 16, 2022
accc414
[MIG] base_comment_template : Migration to 16.0
mhachraf Oct 18, 2022
5c63dee
[UPD] Update base_comment_template.pot
Oct 25, 2022
5185eaf
[UPD] README.rst
OCA-git-bot Oct 25, 2022
7dd5eee
Update translation files
weblate Oct 25, 2022
358c636
Translated using Weblate (Spanish (Argentina))
ibuioli Oct 30, 2022
d227a29
Translated using Weblate (German)
marylla Nov 4, 2022
ba957ba
[FIX] base_comment_template: Add models text field to prevent error f…
victoralmau Nov 2, 2022
279ba60
[UPD] Update base_comment_template.pot
Nov 30, 2022
53c43a1
base_comment_template 16.0.2.0.0
OCA-git-bot Nov 30, 2022
18d0bbc
Update translation files
weblate Nov 30, 2022
ba82c26
Translated using Weblate (Spanish (Argentina))
ibuioli Dec 4, 2022
76d92c8
Translated using Weblate (Italian)
mymage Mar 23, 2023
0605e55
Translated using Weblate (Slovenian)
sysadminmatmoz Apr 11, 2023
3ac7bdd
Translated using Weblate (Italian)
mymage Jun 14, 2023
e7326a3
Translated using Weblate (Italian)
francesco-ooops Jul 12, 2023
1812c07
[FIX] base_comment_template: search when multiple models in a template
AaronHForgeFlow Jul 19, 2023
65d84c7
base_comment_template 16.0.2.0.1
OCA-git-bot Jul 28, 2023
3414ea7
[IMP] base_comment_template: allow to show code view in text field
alan196 Aug 21, 2023
644a243
[IMP] base_comment_template: allow to select rendering engine in comm…
alan196 Aug 29, 2023
c21f94f
Translated using Weblate (Spanish)
Ivorra78 Aug 23, 2023
b623133
[UPD] README.rst
OCA-git-bot Sep 3, 2023
6fe6c89
[UPD] Update base_comment_template.pot
Sep 3, 2023
c2e4bc3
base_comment_template 16.0.2.1.0
OCA-git-bot Sep 3, 2023
1ec9ef6
[UPD] README.rst
OCA-git-bot Sep 3, 2023
cf4abbe
Update translation files
weblate Sep 3, 2023
656e06a
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 4, 2023
75cad6c
Translated using Weblate (Spanish)
Ivorra78 Sep 7, 2023
6fea7cd
Update translation files
weblate Oct 10, 2023
2ec8a0e
[IMP]base_comment_template: using markup.safe to render html in report
matteonext Dec 20, 2023
189ff51
[BOT] post-merge updates
OCA-git-bot Dec 27, 2023
d0785d1
Translated using Weblate (Italian)
mymage Dec 28, 2023
575b0b5
[BOT] post-merge updates
OCA-git-bot Jan 11, 2024
31446d7
Translated using Weblate (Italian)
mymage Jan 18, 2024
57b582f
[IMP] base_comment_template: update readme files
alan196 Aug 22, 2023
e1e49f8
[BOT] post-merge updates
OCA-git-bot May 3, 2024
7234782
[IMP] base_comment_template: pre-commit auto fixes
alan196 May 3, 2024
e3abb35
[MIG] base_comment_template: Migration to 17.0
alan196 May 3, 2024
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
204 changes: 204 additions & 0 deletions base_comment_template/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
=======================
Base Comments Templates
=======================

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

.. |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/licence-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/17.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-17-0/reporting-engine-17-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=17.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:%2017.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 <xavier.jimenez@qubiq.es>
- Nicolas Bessi <nicolas.bessi@camptocamp.com>
- Yannick Vaucher <yannick.vaucher@camptocamp.com>
- Guewen Baconnier <guewen.baconnier@camptocamp.com>
- Simone Rubino <simone.rubino@agilebg.com>
- `DynApps <https://www.dynapps.be>`__:

- Raf Ven <raf.ven@dynapps.be>

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

- Iván Todorovich <ivan.todorovich@druidoo.io>

- Pierre Verkest <pierreverkest84@gmail.com>
- `NextERP Romania <https://www.nexterp.ro>`__:

- Fekete Mihai <feketemihai@nexterp.ro>

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

- Carlos Roca
- Víctor Martínez

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

- Alan Ramos <alan.ramos@jarsa.com>

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

- Achraf Mhadhbi <machraf@bloopark.de>

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/17.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": "17.0.1.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
Loading