v 13.0 Third Party 1191
Download for v 13.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 379
Technical Name report_qweb_signer
LicenseAGPL-3
Websitehttps://github.com/OCA/reporting-engine
Versions 13.0 8.0 14.0 10.0 12.0
You bought this module and need support? Click here!

Qweb PDF reports signer

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

This module extends the functionality of report module to sign PDFs using a PKCS#12 certificate.

Table of contents

Installation

To install this module, you need to install Java JDK Headlees, e.g.:

apt-get install default-jre-headless

Configuration

In order to start signing PDF documents you need to configure certificate(s) to use in your company.

  • Go to Settings > Companies > Companies > Your company
  • Go to Report configuration tab
  • Click Edit
  • Add a new item in PDF report certificates list
  • Click Create
  • Set name, certificate file, password file and model
  • Optionally you can set a domain and filename pattern for saving as attachment

For example, if you want to sign only customer invoices in open or paid state:

  • Model: account.invoice
  • Domain: [('type','=','out_invoice'), ('state', 'in', ('open', 'paid'))]
  • Save as attachment: (object.number or '').replace('/','_') + '.signed.pdf'

Note: Linux user that executes Odoo server process must have read access to certificate file and password file

Java Memory Settings

If you are signing large amounts of reports at the same time, or if you have a lower worker memory size than the JVM defaults, you may need to tune the JVM heap memory limits. Do so by adding a $JVM_ARGS environment variable that contains the required flags. Check out these links too:

  • StackOverflow answer.
  • Java docs.

Usage

User just prints PDF documents (only Qweb PDF reports supported) as usual, but signed PDF is automatically downloaded if this document model is configured as indicated above.

If ‘Save as attachment’ is configured, signed PDF is saved as attachment and next time saved one is downloaded without signing again. This is appropiate when signing date is important, for example, when signing customer invoices.

You can try the signing with the demo report that is included for customers called “Test PDF certificate”.

You can set extra parameters of JSignPdf library in the system parameter named ‘report_qweb_signer.java_position_parameters’, for example ‘-V’ to visible signature into pdf. You can also set extra parameters for Java in the system parameter named ‘report_qweb_signer.java_parameters’.

Known issues / Roadmap

  • When signing multiple documents (if ‘Allow only one document’ is disable) then ‘Save as attachment’ is not applied and signed result is not saved as attachment.
  • Add tests.
  • Why not taking the occasion to add the whole configuration at report level (if to be signed or not, the domain, etc…)? See https://github.com/OCA/reporting-engine/pull/533#issuecomment-898321161

Bug Tracker

Bugs are tracked on GitHub 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.

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

Credits

Authors

  • Tecnativa

Contributors

Other credits

External utilities

  • JSignPdf: © Josef Cacek - License MPL or LGPL2 - http://jsignpdf.sourceforge.net/

Icon

Created by Anton Noskov from the Noun Project

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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 project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.