@@ -7,7 +7,7 @@ Qweb PDF reports signer
77 !! This file is generated by oca-gen-addon-readme !!
88 !! changes will be overwritten. !!
99 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10- !! source digest: sha256:98ab01f40082429507d6180e23d3ffba607dff06c259e5adf5e41fd07bf25b76
10+ !! source digest: sha256:8e3e54c5fb4cf809950609cadd0a782a02940ee7a40be85ffbc935d24ec465fa
1111 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313.. |badge1 | image :: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -28,8 +28,8 @@ Qweb PDF reports signer
2828
2929|badge1 | |badge2 | |badge3 | |badge4 | |badge5 |
3030
31- This module extends the functionality of report module to sign PDFs
32- using a PKCS#12 certificate.
31+ This module extends the functionality of reports to sign PDFs using a
32+ PKCS#12 certificate.
3333
3434**Table of contents **
3535
@@ -39,49 +39,36 @@ using a PKCS#12 certificate.
3939Installation
4040============
4141
42- To install this module, you need to install Java JDK Headlees , e.g.:
42+ To install this module, you need to install pyhanko-cli , e.g.:
4343
44- apt-get install default-jre-headless
44+ pipx install pyhanko-cli
4545
4646Configuration
4747=============
4848
49- In order to start signing PDF documents you need to configure
50- certificate(s) to use in your company.
49+ To start signing PDF reports you'll need first to configure your desired
50+ certificate. To do so:
5151
52- - Go to ``Settings > Companies > Companies > Your company ``
53- - Go to ``Report configuration `` tab
54- - Click ``Edit ``
55- - Add a new item in ``PDF report certificates `` list
56- - Click ``Create ``
57- - Set name, certificate file, password file and model
58- - Optionally you can set a domain and filename pattern for saving as
59- attachment
52+ - Go to *Settings > General Settings * and then to the section
53+ *Certificates and Keys *. Then click on **Certificates **.
54+ - Add the cert you want to use: upload the file and set the password.
6055
61- For example, if you want to sign only customer invoices in posted state :
56+ Now you need to configure the reports using this certificate :
6257
63- - Model: `` account.move ``
64- - Domain:
65- `` [('move_type','=','out_invoice'), ('state', '=', 'posted')] ``
66- - Save as attachment:
67- `` (object.name or '').replace('/','_') + '.signed.pdf' ``
58+ - Go to * Settings > Thecnical > Reporting > Reports *.
59+ - Search for the pdf report you want to sign.
60+ - In the report form, open the ** Sign ** tab.
61+ - Choose the ** Certificate ** you created before.
62+ - Optionally, you can set:
6863
69- **Note **: Linux user that executes Odoo server process must have read
70- access to certificate file and password file
71-
72- Java Memory Settings
73- --------------------
74-
75- If you are signing large amounts of reports at the same time, or if you
76- have a lower worker memory size than the JVM defaults, you may need to
77- tune the JVM heap memory limits. Do so by adding a ``$JVM_ARGS ``
78- environment variable that contains the required flags. Check out these
79- links too:
80-
81- - `StackOverflow
82- answer <https://stackoverflow.com/a/14763095/1468388> `__.
83- - `Java
84- docs <https://docs.oracle.com/cd/E15523_01/web.1111/e13814/jvm_tuning.htm#PERFM161> `__.
64+ - **Allow to sign only one document **: disallow signing a pdf that
65+ contains multiple docs.
66+ - **Save as attachment **: Set the signed document report file name
67+ pattern. Example:
68+ ``(object.name or '').replace('/','_') + '.signed.pdf' ``
69+ - **Signing domain **: Filter the document that will be signed.
70+ Example:
71+ ``[('move_type','=','out_invoice'), ('state', '=', 'posted')] ``
8572
8673Usage
8774=====
@@ -98,21 +85,25 @@ customer invoices.
9885You can try the signing with the demo report that is included for
9986customers called "Test PDF certificate".
10087
101- You can set extra parameters of JSignPdf library in the system parameter
102- named 'report_qweb_signer.java_position_parameters', for example '-V' to
103- visible signature into pdf. You can also set extra parameters for Java
104- in the system parameter named 'report_qweb_signer.java_parameters'.
105-
10688Known issues / Roadmap
10789======================
10890
109- - When signing multiple documents (if 'Allow only one document' is
110- disable) then 'Save as attachment' is not applied and signed result is
111- not saved as attachment.
112- - Add tests.
113- - Why not taking the occasion to add the whole configuration at report
114- level (if to be signed or not, the domain, etc...)? See
115- https://github.com/OCA/reporting-engine/pull/533#issuecomment-898321161
91+ - This version 18.0 depends on pyhanko-cli for signing the documents,
92+ which isn't ideal at all but avoids the dependency hell coming from
93+ cryptography requisites.
94+ - In Odoo 19.0 Odoo implemented their own signing mechanism. We could
95+ backport it but it depends on python 12 which supports the proper
96+ cryptography library version and that would leave out any
97+ infrastructure using lower versions. So: for v19 we should get rid of
98+ all that external stuff and just use the core one. (ref:
99+ https://github.com/odoo/odoo/pull/194698)
100+ - When signing multiple documents (if *Allow only one document * is
101+ disabled) then *Save as attachment * is not applied and signed result
102+ is not saved as attachment.
103+ - Add more tests.
104+ - This module is incompatible with the ``account_edi_ubl_cii `` module,
105+ because the PDF content is altered after rendering. See:
106+ https://github.com/odoo/odoo/blob/5977da2c93d522ece984d2fa8a31624f4b612eca/addons/account_edi_ubl_cii/models/account_move_send.py#L131C9-L140
116107
117108Bug Tracker
118109===========
@@ -154,13 +145,6 @@ Contributors
154145Other credits
155146-------------
156147
157- External utilities
158- ~~~~~~~~~~~~~~~~~~
159-
160- - JSignPdf: © Josef Cacek - License `MPL <http://www.mozilla.org/MPL >`__
161- or `LGPL2 <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html >`__
162- - http://jsignpdf.sourceforge.net/
163-
164148Icon
165149~~~~
166150
0 commit comments