Skip to content

[18.0][MIG] report_qweb_signer: Migration to 18.0 - #1105

Open
chienandalu wants to merge 64 commits into
OCA:18.0from
moduon:18.0-mig-report_qweb_signer
Open

[18.0][MIG] report_qweb_signer: Migration to 18.0 #1105
chienandalu wants to merge 64 commits into
OCA:18.0from
moduon:18.0-mig-report_qweb_signer

Conversation

@chienandalu

Copy link
Copy Markdown
Member

superseds #1060

Refactor to use pyHanko and the new Odoo core certificate.certificate model.

For now, a minimal refactor has been made as PoC to:

  • Use PyHanko as the signer library (more complete, mantained and reliable)
  • Remove all the forme java pdfsigner stuff.
  • Be able to use Odoo core certificates.

Main pain points:

  • cryptography version is fixed in Odoo requirements.txt. This makes very hard for other libraries to work with that version.
  • The approach has been using the pyhanko-cli tool as backend so we can install it in it's own venv (or whatever isolation method is desired).

cc @moduon MT-11131

fyi @yajo

@chienandalu
chienandalu force-pushed the 18.0-mig-report_qweb_signer branch 2 times, most recently from 71070b5 to 212514f Compare December 18, 2025 12:06

@yajo yajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the good work, it looks much better indeed.

Code review with some comments in code.

Please also review tests, which are failing.

def migrate(cr, version):
# 1. Store certificate info (file path) to create the certs on post-mig
# 2. Transform report.certificate to their reports values
pass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: missing implementation.

and self.signing_allow_only_one
and len(res_ids) > 1
):
_logger.debug(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: higher importance

Suggested change
_logger.debug(
_logger.warning(

Comment on lines +57 to +60
ids = set(
self.env[self.model_id.model].search(safe_eval(self.signing_domain)).ids
)
res_ids = list(ids & set(res_ids))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ids = set(
self.env[self.model_id.model].search(safe_eval(self.signing_domain)).ids
)
res_ids = list(ids & set(res_ids))
res_ids = self.env[self.model_id.model].search([("id", "in", res_ids)] + safe_eval(self.signing_domain)).ids


def _should_be_signed(self, res_ids: list) -> list:
"""Not all the documents should be rendered. Let's find out the right ones"""
if not self._is_report_type_signable():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not self._is_report_type_signable():
if not self._is_report_type_signable() or not res_ids:

@@ -6,10 +6,10 @@
> - Jairo Llopis
> - David Vidal

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: IMHO Moduon deserves a mention, after this huge refactor.

@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 24, 2026
@chienandalu

Copy link
Copy Markdown
Member Author

@yajo set to no stale, please

@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 31, 2026
@yajo yajo added the no stale Use this label to prevent the automated stale action from closing this PR/Issue. label Jun 23, 2026
@yajo

yajo commented Jun 23, 2026

Copy link
Copy Markdown
Member

Tests are broken. Would you fix them please?

@chienandalu
chienandalu force-pushed the 18.0-mig-report_qweb_signer branch from 212514f to 0485c9f Compare August 3, 2026 10:27
@OCA-git-bot OCA-git-bot added series:18.0 mod:report_qweb_signer Module report_qweb_signer labels Aug 3, 2026
@chienandalu
chienandalu force-pushed the 18.0-mig-report_qweb_signer branch from 0485c9f to 15640b2 Compare August 3, 2026 10:28
antespi and others added 17 commits August 3, 2026 12:56
OCA Transbot updated translations from Transifex
OCA Transbot updated translations from Transifex
These limits were being hit when printing PDF reports with just 80 pages.

OCA Transbot updated translations from Transifex

[UPD] Update report_qweb_signer.pot
- Good dependency chain
- Context for forcing rendering PDF
- Extra test

[UPD] README.rst

[UPD] Update report_qweb_signer.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-12.0/reporting-engine-12.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_qweb_signer/

[UPD] README.rst
`render_qweb_pdf` must return a tuple of `(content, 'pdf')`
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-12.0/reporting-engine-12.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_qweb_signer/
Fix website on manifest
[UPD] Update report_qweb_signer.pot

[UPD] README.rst
OCA-git-bot and others added 29 commits August 3, 2026 12:56
Currently translated at 26.0% (12 of 46 strings)

Translation: reporting-engine-14.0/reporting-engine-14.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_qweb_signer/it/
Currently translated at 63.0% (29 of 46 strings)

Translation: reporting-engine-14.0/reporting-engine-14.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_qweb_signer/sl/
Currently translated at 100.0% (46 of 46 strings)

Translation: reporting-engine-14.0/reporting-engine-14.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_qweb_signer/ca/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-14.0/reporting-engine-14.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_qweb_signer/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-14.0/reporting-engine-14.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_qweb_signer/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-16.0/reporting-engine-16.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_qweb_signer/
Currently translated at 100.0% (46 of 46 strings)

Translation: reporting-engine-16.0/reporting-engine-16.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_qweb_signer/es/
Currently translated at 100.0% (46 of 46 strings)

Translation: reporting-engine-16.0/reporting-engine-16.0-report_qweb_signer
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_qweb_signer/it/
Refactor to use pyHanko and the new Odoo core `certificate.certificate` model.

For now, a minimal refactor has been made as PoC to:

- Use PyHanko as the signer library (more complete, mantained and reliable)
- Remove all the forme java pdfsigner stuff.
- Be able to use Odoo core certificates.

Main pain points:

- `cryptography` version is fixed in Odoo `requirements.txt`. This makes very hard for other libraries to work with that version.
- The approach has been using the `pyhanko-cli` tool as backend so we can install it in it's own `venv` (or whatever isolation method is desired).

MT-11131
@chienandalu
chienandalu force-pushed the 18.0-mig-report_qweb_signer branch from 15640b2 to 5f37645 Compare August 3, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:report_qweb_signer Module report_qweb_signer no stale Use this label to prevent the automated stale action from closing this PR/Issue. series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.