[FIX] report_qweb_encrypt: accept single res_id - #1191
Open
moylop260 wants to merge 1 commit into
Open
Conversation
Contributor
|
Hi @kittiu, |
moylop260
force-pushed
the
19.0-fix-report-qweb-encrypt-single-res-id
branch
from
August 24, 2026 05:41
1cb3f61 to
e688184
Compare
nhomar
approved these changes
Aug 26, 2026
fernandahf
approved these changes
Aug 26, 2026
luisg123v
suggested changes
Aug 26, 2026
luisg123v
left a comment
There was a problem hiding this comment.
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
force-pushed
the
19.0-fix-report-qweb-encrypt-single-res-id
branch
from
August 27, 2026 07:58
e688184 to
88d69f4
Compare
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 |
Author
|
ocabot merge patch |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Odoo's PDF report API accepts
res_idseither as a list or as a single integer. This mirrors how Odoo normalizesres_idsinternally before continuing the rendering flow:There are real callers that use the single-id form. For example,
stock.pickingrenders the delivery report withself.id:report_qweb_encryptkept using the originalres_idsvalue after callingsuper()and sliced it to evaluate the encryption password. When a caller passed a single id, slicing the integer raisedTypeErrorbefore the password could be read.This change normalizes the local value before calling
_get_pdf_passwordand adds a regression test for the single-id form.