Skip to content

[FIX] report_qweb_encrypt: accept single res_id - #1191

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
vauxoo-dev:19.0-fix-report-qweb-encrypt-single-res-id
Aug 27, 2026
Merged

[FIX] report_qweb_encrypt: accept single res_id#1191
OCA-git-bot merged 1 commit into
OCA:19.0from
vauxoo-dev:19.0-fix-report-qweb-encrypt-single-res-id

Conversation

@moylop260

Copy link
Copy Markdown

Odoo's PDF report API accepts res_ids either as a list or as a single integer. This mirrors how Odoo normalizes res_ids internally before continuing the rendering flow:

There are real callers that use the single-id form. For example, stock.picking renders the delivery report with self.id:

report_qweb_encrypt kept using the original res_ids value after calling super() and sliced it to evaluate the encryption password. When a caller passed a single id, slicing the integer raised TypeError before the password could be read.

This change normalizes the local value before calling _get_pdf_password and adds a regression test for the single-id form.

@moylop260 moylop260 self-assigned this Aug 24, 2026
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @kittiu,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:19.0 mod:report_qweb_encrypt Module report_qweb_encrypt labels Aug 24, 2026
@moylop260
moylop260 force-pushed the 19.0-fix-report-qweb-encrypt-single-res-id branch from 1cb3f61 to e688184 Compare August 24, 2026 05:41

@luisg123v luisg123v left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Regarding commit message:

  • Lines are too long, please wrap to e.g. 72 characters
  • It says "add a regression test", which I think is not as accurate, as no tests are added, an existing one is modified to cover that case.

Odoo's PDF report API accepts res_ids either as a list or as a single
integer. This mirrors how Odoo normalizes res_ids internally before
continuing the rendering flow:

- https://github.com/odoo/odoo/blob/80e1a4464f75df5beeae0d8205a282da755c1a7d/odoo/addons/base/models/ir_actions_report.py#L659

There are real callers that use the single-id form. For example,
stock.picking renders the delivery report with self.id:

- https://github.com/odoo/odoo/blob/ba4315ec85341431dd9bcd4f4d64217c37a4865f/addons/stock/models/stock_picking.py#L2014

report_qweb_encrypt kept using the original res_ids value after calling
super() and sliced it to evaluate the encryption password. When a caller
passed a single id, slicing the integer raised TypeError before the
password could be read.

Normalize the local value before calling _get_pdf_password, and change
the existing test to pass a single res_id, which is the form that used
to fail.
@moylop260
moylop260 force-pushed the 19.0-fix-report-qweb-encrypt-single-res-id branch from e688184 to 88d69f4 Compare August 27, 2026 07:58
@moylop260

Copy link
Copy Markdown
Author

@luisg123v addressed in the same commit: the message is now wrapped at 72 characters, and the last paragraph says that the existing test is changed to pass a single res_id, instead of claiming a new test is added. No code change, and the five checks are green.

@moylop260

Copy link
Copy Markdown
Author

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 19.0-ocabot-merge-pr-1191-by-moylop260-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 6ee053a into OCA:19.0 Aug 27, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at b730d60. Thanks a lot for contributing to OCA. ❤️

@moylop260
moylop260 deleted the 19.0-fix-report-qweb-encrypt-single-res-id branch August 27, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants