Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
58b3e97
[ADD] report_qweb_encrypt
etobella Sep 16, 2020
1e12ece
[ENH] Add option to auto encrypt password based on python syntax
kittiu Dec 26, 2020
e4884e0
[IMP] : black, isort, prettier
kittiu Feb 9, 2021
e799fc0
[14.0][MIG] report_qweb_encrypt
kittiu Feb 9, 2021
417b79b
Added translation using Weblate (Spanish)
anasuarez1 Mar 16, 2021
a416460
[FIX] report_qweb_encrypt: conflict with bank statement
ps-tubtim Jan 7, 2022
9b38680
[FIX] report_qweb_encrypt: the case without res_ids
StefanRijnhart May 11, 2022
413846c
[FIX] report_download controller method signature in two modules
StefanRijnhart May 11, 2022
056e822
[FIX] readme sample
KKamaa Apr 15, 2022
8e29254
[MIG] report_qweb_encrypt: Migration to 15.0
grzana12 Nov 5, 2022
b9c3a2c
Translated using Weblate (Spanish)
Ivorra78 Jul 13, 2023
12cedfb
[MIG] report_qweb_encrypt: Migration to 16.0
payen000 Aug 3, 2023
e63f5f1
[FIX] report_qweb_encrypt: Use _get_report instead of _get_report_fro…
rolandojduartem Oct 19, 2023
b9feed1
[FIX] report_qweb_encrypt: report_ref in base provides recordset inst…
atchuthan Oct 12, 2023
d6bf944
Added translation using Weblate (Italian)
mymage Jan 10, 2024
dae75a6
Translated using Weblate (Italian)
mymage Jan 18, 2024
ffd8cfb
[IMP] report_qweb_encrypt: pre-commit execution
CLaurelB Sep 4, 2025
ea3b075
[MIG] report_qweb_encrypt: Migration to 18.0
CLaurelB Sep 4, 2025
f809c92
Translated using Weblate (Italian)
mymage Dec 17, 2025
ad54c26
[IMP] report_qweb_encrypt: pre-commit auto fixes
moylop260 Aug 14, 2026
64c44de
[MIG] report_qweb_encrypt: Migration to 19.0
moylop260 Aug 14, 2026
668b8cd
[IMP] report_qweb_encrypt: cover the /report/download override
moylop260 Aug 15, 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
100 changes: 100 additions & 0 deletions report_qweb_encrypt/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================
Report Qweb Encrypt
===================

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

.. |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/report_qweb_encrypt
: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-report_qweb_encrypt
: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|

This module allow you to encrypt PDF with a password seting option,

- Manually keyin password (only applicable for record print action)
- Auto generated password based on object data (python)

**Table of contents**

.. contents::
:local:

Usage
=====

To make a report encryptable mark the field Encryption in the report
record.

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:%20report_qweb_encrypt%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
-------

* Creu Blanca
* Ecosoft

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

- Enric Tobella <etobella@creublanca.es>
- Jaime Arroyo <jaime.arroyo@creublanca.es>
- Kitti U. <kittiu@ecosoft.co.th>

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.

.. |maintainer-kittiu| image:: https://github.com/kittiu.png?size=40px
:target: https://github.com/kittiu
:alt: kittiu

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kittiu|

This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/19.0/report_qweb_encrypt>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions report_qweb_encrypt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
26 changes: 26 additions & 0 deletions report_qweb_encrypt/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2020 Creu Blanca
# Copyright 2020 Ecosoft Co., Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Report Qweb Encrypt",
"summary": "Allow to encrypt qweb pdfs",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Ecosoft,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
"depends": [
"web",
],
"data": [
"views/ir_actions_report.xml",
],
"assets": {
"web.assets_backend": [
"report_qweb_encrypt/static/src/report/action_manager_report.esm.js",
"report_qweb_encrypt/static/src/report/encrypt_dialog.xml",
],
},
"installable": True,
"maintainers": ["kittiu"],
}
1 change: 1 addition & 0 deletions report_qweb_encrypt/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
39 changes: 39 additions & 0 deletions report_qweb_encrypt/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2020 Creu Blanca
# Copyright 2020 Ecosoft Co., Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import json

from werkzeug.urls import url_decode

from odoo.http import request, route

from odoo.addons.web.controllers.report import ReportController


class ReportControllerEncrypt(ReportController):
@route()
def report_download(self, data, context=None, token=None, readonly=True):
result = super().report_download(
data, context=context, token=token, readonly=readonly
)
# When report is downloaded from print action, this function is called,
# but this function cannot pass context (manually entered password) to
# report.render_qweb_pdf(), encrypton for manual password is done here.
if result.headers.get("Content-Type") != "application/pdf":
return result
request_content = json.loads(data)
url, ttype = request_content[0], request_content[1]
if ttype != "qweb-pdf" or "?" not in url:
return result
args = dict(
url_decode(url.split("?", 1)[1])
) # decoding the args represented in JSON
data_context = json.loads(args.get("context", "{}"))
encrypt_password = data_context.get("encrypt_password")
if not encrypt_password:
return result
encrypted_data = request.env["ir.actions.report"]._encrypt_pdf(
result.get_data(), encrypt_password
)
result.set_data(encrypted_data)
return result
99 changes: 99 additions & 0 deletions report_qweb_encrypt/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_qweb_encrypt
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-13 20:08+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: report_qweb_encrypt
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__encrypt
#: model:ir.model.fields,help:report_qweb_encrypt.field_report_pdf_form__encrypt
msgid ""
"* Manual Input Password: allow user to key in password on the fly. This "
"option available only on document print action.\n"
"* Auto Generated Password: system will auto encrypt password when PDF "
"created, based on provided python syntax."
msgstr ""
"* Contraseña de entrada manual: permite al usuario introducir la contraseña "
"sobre la marcha. Esta opción sólo está disponible en la acción de impresión "
"de documentos.\n"
"* Contraseña generada automáticamente: el sistema cifrará automáticamente la "
"contraseña cuando se cree el PDF, basándose en la sintaxis python "
"proporcionada."

#. module: report_qweb_encrypt
#: model:ir.model.fields.selection,name:report_qweb_encrypt.selection__ir_actions_report__encrypt__auto
msgid "Auto Generated Password"
msgstr "Contraseña generada automáticamente"

#. module: report_qweb_encrypt
#. odoo-javascript
#: code:addons/report_qweb_encrypt/static/src/report/encrypt_dialog.xml:0
msgid "Cancel"
msgstr "Cancelar"

#. module: report_qweb_encrypt
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt_password
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_report_pdf_form__encrypt_password
msgid "Encrypt Password"
msgstr "Encriptar contraseña"

#. module: report_qweb_encrypt
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_report_pdf_form__encrypt
msgid "Encryption"
msgstr "Encriptación"

#. module: report_qweb_encrypt
#. odoo-javascript
#: code:addons/report_qweb_encrypt/static/src/report/encrypt_dialog.xml:0
msgid "Enter password"
msgstr ""

#. module: report_qweb_encrypt
#: model:ir.model.fields.selection,name:report_qweb_encrypt.selection__ir_actions_report__encrypt__manual
msgid "Manual Input Password"
msgstr "Contraseña de entrada manual"

#. module: report_qweb_encrypt
#. odoo-javascript
#: code:addons/report_qweb_encrypt/static/src/report/encrypt_dialog.xml:0
msgid "Ok"
msgstr "Aceptar"

#. module: report_qweb_encrypt
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__encrypt_password
#: model:ir.model.fields,help:report_qweb_encrypt.field_report_pdf_form__encrypt_password
msgid "Python code syntax to gnerate password."
msgstr "Sintaxis del código Python para generar la contraseña."

#. module: report_qweb_encrypt
#. odoo-python
#: code:addons/report_qweb_encrypt/models/ir_actions_report.py:0
msgid ""
"Python code used for encryption password is invalid.\n"
"%s"
msgstr ""
"El código Python utilizado para cifrar la contraseña no es válido.\n"
"%s"

#. module: report_qweb_encrypt
#: model:ir.model,name:report_qweb_encrypt.model_ir_actions_report
msgid "Report Action"
msgstr "Informar Acción"

#. module: report_qweb_encrypt
#: model_terms:ir.ui.view,arch_db:report_qweb_encrypt.ir_actions_report_form_view
msgid "python syntax, i.e., (object.default_code or 'secretcode')"
msgstr "sintaxis python, es decir, (object.default_code o 'secretcode')"
97 changes: 97 additions & 0 deletions report_qweb_encrypt/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_qweb_encrypt
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-12-17 10:42+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: report_qweb_encrypt
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__encrypt
#: model:ir.model.fields,help:report_qweb_encrypt.field_report_pdf_form__encrypt
msgid ""
"* Manual Input Password: allow user to key in password on the fly. This "
"option available only on document print action.\n"
"* Auto Generated Password: system will auto encrypt password when PDF "
"created, based on provided python syntax."
msgstr ""
"* Inserimento manuale password: consente all'utente di inserire la password "
"al volo. Questa opzione è disponibile solo nell'azione stampa documento.\n"
"* Password auto generata: il sistema cripterà automaticamente la password "
"quando viene creato il PDF, in base alla sintassi Pythn fornita."

#. module: report_qweb_encrypt
#: model:ir.model.fields.selection,name:report_qweb_encrypt.selection__ir_actions_report__encrypt__auto
msgid "Auto Generated Password"
msgstr "Password generata automaticamente"

#. module: report_qweb_encrypt
#. odoo-javascript
#: code:addons/report_qweb_encrypt/static/src/report/encrypt_dialog.xml:0
msgid "Cancel"
msgstr "Annulla"

#. module: report_qweb_encrypt
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt_password
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_report_pdf_form__encrypt_password
msgid "Encrypt Password"
msgstr "Cripta password"

#. module: report_qweb_encrypt
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_report_pdf_form__encrypt
msgid "Encryption"
msgstr "Criptazione"

#. module: report_qweb_encrypt
#. odoo-javascript
#: code:addons/report_qweb_encrypt/static/src/report/encrypt_dialog.xml:0
msgid "Enter password"
msgstr "Inserire password"

#. module: report_qweb_encrypt
#: model:ir.model.fields.selection,name:report_qweb_encrypt.selection__ir_actions_report__encrypt__manual
msgid "Manual Input Password"
msgstr "Password inserita manualmente"

#. module: report_qweb_encrypt
#. odoo-javascript
#: code:addons/report_qweb_encrypt/static/src/report/encrypt_dialog.xml:0
msgid "Ok"
msgstr "Ok"

#. module: report_qweb_encrypt
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__encrypt_password
#: model:ir.model.fields,help:report_qweb_encrypt.field_report_pdf_form__encrypt_password
msgid "Python code syntax to gnerate password."
msgstr "Sintassi codice Python per generazione password."

#. module: report_qweb_encrypt
#. odoo-python
#: code:addons/report_qweb_encrypt/models/ir_actions_report.py:0
msgid ""
"Python code used for encryption password is invalid.\n"
"%s"
msgstr ""
"Il codice Python usato per la criptazione password non è valido.\n"
"%s"

#. module: report_qweb_encrypt
#: model:ir.model,name:report_qweb_encrypt.model_ir_actions_report
msgid "Report Action"
msgstr "Azione resoconto"

#. module: report_qweb_encrypt
#: model_terms:ir.ui.view,arch_db:report_qweb_encrypt.ir_actions_report_form_view
msgid "python syntax, i.e., (object.default_code or 'secretcode')"
msgstr "Sintassi Python, es., (object.default_code o 'secretcode')"
Loading
Loading