-
-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] report_qweb_encrypt: Migration to 16.0
- Loading branch information
Showing
23 changed files
with
1,030 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
=================== | ||
Report Qweb Encrypt | ||
=================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/15.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-15-0/reporting-engine-15-0-report_qweb_encrypt | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/143/15.0 | ||
:alt: Try me on Runbot | ||
|
||
|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 smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qweb_encrypt%0Aversion:%2015.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/15.0/report_qweb_encrypt>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import controllers | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 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": "16.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/js/report/action_manager_report.esm.js", | ||
"report_qweb_encrypt/static/src/js/report/encrypt_dialog.xml", | ||
], | ||
}, | ||
"external_dependencies": { | ||
"python": ["PyPDF2"] # Python third party libraries required for module | ||
}, | ||
"installable": True, | ||
"maintainers": ["kittiu"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): | ||
result = super().report_download(data, context=context) | ||
# 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. | ||
requestcontent = json.loads(data) | ||
url, ttype = requestcontent[0], requestcontent[1] | ||
if ( | ||
ttype in ["qweb-pdf"] | ||
and result.headers["Content-Type"] == "application/pdf" | ||
and "?" in url | ||
): | ||
data = dict( | ||
url_decode(url.split("?")[1]).items() | ||
) # decoding the args represented in JSON | ||
if "context" in data: | ||
context, data_context = json.loads(context or "{}"), json.loads( | ||
data.pop("context") | ||
) | ||
if "encrypt_password" in data_context: | ||
encrypted_data = request.env["ir.actions.report"]._encrypt_pdf( | ||
result.get_data(), data_context["encrypt_password"] | ||
) | ||
result.set_data(encrypted_data) | ||
return result | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# 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" | ||
"Last-Translator: Automatically generated\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" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__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 "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields.selection,name:report_qweb_encrypt.selection__ir_actions_report__encrypt__auto | ||
msgid "Auto Generated Password" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#. openerp-web | ||
#: code:addons/report_qweb_encrypt/static/src/js/report/encrypt_dialog.xml:0 | ||
#, python-format | ||
msgid "Cancel" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt_password | ||
msgid "Encrypt Password" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt | ||
msgid "Encryption" | ||
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 "" | ||
|
||
#. module: report_qweb_encrypt | ||
#. openerp-web | ||
#: code:addons/report_qweb_encrypt/static/src/js/report/encrypt_dialog.xml:0 | ||
#, python-format | ||
msgid "Ok" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__encrypt_password | ||
msgid "Python code syntax to gnerate password." | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: code:addons/report_qweb_encrypt/models/ir_actions_report.py:0 | ||
#, python-format | ||
msgid "" | ||
"Python code used for encryption password is invalid.\n" | ||
"%s" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model,name:report_qweb_encrypt.model_ir_actions_report | ||
msgid "Report Action" | ||
msgstr "" | ||
|
||
#. 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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * report_qweb_encrypt | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__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 "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields.selection,name:report_qweb_encrypt.selection__ir_actions_report__encrypt__auto | ||
msgid "Auto Generated Password" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#. openerp-web | ||
#: code:addons/report_qweb_encrypt/static/src/js/report/encrypt_dialog.xml:0 | ||
#, python-format | ||
msgid "Cancel" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt_password | ||
msgid "Encrypt Password" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,field_description:report_qweb_encrypt.field_ir_actions_report__encrypt | ||
msgid "Encryption" | ||
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 "" | ||
|
||
#. module: report_qweb_encrypt | ||
#. openerp-web | ||
#: code:addons/report_qweb_encrypt/static/src/js/report/encrypt_dialog.xml:0 | ||
#, python-format | ||
msgid "Ok" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model.fields,help:report_qweb_encrypt.field_ir_actions_report__encrypt_password | ||
msgid "Python code syntax to gnerate password." | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: code:addons/report_qweb_encrypt/models/ir_actions_report.py:0 | ||
#, python-format | ||
msgid "" | ||
"Python code used for encryption password is invalid.\n" | ||
"%s" | ||
msgstr "" | ||
|
||
#. module: report_qweb_encrypt | ||
#: model:ir.model,name:report_qweb_encrypt.model_ir_actions_report | ||
msgid "Report Action" | ||
msgstr "" | ||
|
||
#. 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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import ir_actions_report |
Oops, something went wrong.