Skip to content

T3351-Fix-failing-quality-test-Print-childpack - #2126

Merged
ecino merged 1 commit into
18.0from
T3351-Fix-failing-quality-test-Print-childpack
Aug 5, 2026
Merged

T3351-Fix-failing-quality-test-Print-childpack#2126
ecino merged 1 commit into
18.0from
T3351-Fix-failing-quality-test-Print-childpack

Conversation

@loris-fab

@loris-fab loris-fab commented Aug 3, 2026

Copy link
Copy Markdown

Goal

This Ticket, reported by Connor. Here are the problems I've identified, in a more specific way.

  • unchecking Print background produces a blank PDF, even with "Print QR code" enabled;
  • selecting several children and printing with Print QR code enabled fails with a server error.
  • The "Open children" server action doesn't work.

Technical aspect

  • Blank page. Without "Print background", the wizard returns a report action and lets the web client fetch the PDF. 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 to child_compassion while its model stayed in child_switzerland as report.childpack_full, losing the module prefix. Since then the lookup silently returns None → New file child_compassion/models/report_childpack.py declaring report.child_compassion.childpack_full / _small, which recover the ids the wizard already puts in data['doc_ids']. It now sits in the same module as the report, so every office benefits, not only installations with child_switzerland.

  • Batch print + QR. _compute_qr_code called self.get_base_url() on the whole recordset, but that method requires a singleton → ValueError: Expected singleton with 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.server with no XML id and no source in any addon. Its Python code returns the Odoo 16 view type, which 17+ rejects (tree was renamed list). To fix it on a real instance:

Settings → Technical → Actions → Server Actions → Open children → tab Python Code, then replace tree,form with list,form:

action = {
    "type": "ir.actions.act_window",
    "res_model": "compassion.child",
    "view_mode": "list,form",          # was "tree,form"
    "domain": [('id', 'in', records.mapped('child_id').ids)],
    "name": "Children on hold"
}

Save, then hard-reload the browser .

2. child_switzerland/models/report_childpack.py needs a follow-up PR on addons-switzerland. Its three classes have been dead since 14.0 (wrong names). report.childpack_full / _small are 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:

- 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.
@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The 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 print_qr render safely by omitting the optional QR image.

Files Needing Attention: None.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the Childpack QR QWeb reproduction script against Odoo 18 QWeb expression compilation using the Switzerland and Nordic payload shapes.
  • Verified that omitting print_qr results in None and does not raise an exception during rendering.
  • Verified that an explicit print_qr=False also renders without exceptions, producing a false render decision.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "[T3351] FIX: Restore childpack printing" | Re-trigger Greptile

@loris-fab
loris-fab requested a review from ecino August 3, 2026 14:46
@ecino
ecino merged commit 5bdeffc into 18.0 Aug 5, 2026
2 checks passed
@ecino
ecino deleted the T3351-Fix-failing-quality-test-Print-childpack branch August 5, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants