T3351-Fix-failing-quality-test-Print-childpack - #2126
Merged
Conversation
- Register report.child_compassion.childpack_full/small rendering models so the report falls back on data['doc_ids']. The web client builds the report URL from the wizard options and drops the record ids, so the report was rendered on an empty recordset and produced a blank PDF whenever "Print background" was left unchecked. - Call get_base_url() per record in _compute_qr_code, as it requires a singleton and raised "Expected singleton" when printing the QR code for several children at once.
Confidence Score: 5/5The change is safe to merge based on the reviewed report-context and per-child QR behavior. No defects remain. The executed QWeb check confirmed that childpack attachment payloads without Files Needing Attention: None.
What T-Rex did
Reviews (1): Last reviewed commit: "[T3351] FIX: Restore childpack printing" | Re-trigger Greptile |
ecino
approved these changes
Aug 5, 2026
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.
Goal
This Ticket, reported by Connor. Here are the problems I've identified, in a more specific way.
Technical aspect
getReportUrl(web/.../reports/utils.js) puts either the wizard options or the record ids in the URL, never both, so the ids are dropped and the report renders on an empty recordset.Odoo's way out is the rendering-context model it looks up by name (
report.+report_name). It used to exist and match, but the 14.0 migration moved the report tochild_compassionwhile its model stayed inchild_switzerlandasreport.childpack_full, losing the module prefix. Since then the lookup silently returnsNone→ New filechild_compassion/models/report_childpack.pydeclaringreport.child_compassion.childpack_full/_small, which recover the ids the wizard already puts indata['doc_ids']. It now sits in the same module as the report, so every office benefits, not only installations withchild_switzerland._compute_qr_codecalledself.get_base_url()on the whole recordset, but that method requires a singleton →ValueError: Expected singletonwith 2+ children. It had been moved inside the loop.Misc
1. The "Open children" action is NOT fixed by this PR . It cannot be, it lives only in the database. Under Sponsorship → Global Childpool → Holds, the ⚙️ Action → Open children entry is an
ir.actions.serverwith no XML id and no source in any addon. Its Python code returns the Odoo 16 view type, which 17+ rejects (treewas renamedlist). To fix it on a real instance:2.
child_switzerland/models/report_childpack.pyneeds a follow-up PR onaddons-switzerland. Its three classes have been dead since 14.0 (wrong names).report.childpack_full/_smallare now redundant with this PR and should be deleted; only the mini childpack is still needed and should be renamed, otherwise it keeps printing blank pages: