T3434-FixChildpack - #2145
Merged
Merged
Conversation
…missing - QWeb overwrites the `lang` rendering value with the environment language (ir.qweb._prepare_environment), so the language selected in the print wizard was lost when base_report_to_printer rendered the report from the user's own environment (send to printer path) and the childpack was printed in the interface language instead. Align the environment language with data["lang"] for all childpack reports (Full, Small and the Swiss Mini, whose rendering models share the same abstract report model). - Show a translated note in the full childpack photo frame when the child has no registered photo (fr/de/it translations included).
Confidence Score: 5/5Safe to merge: no blocking failure remains. The report rendering behavior was exercised with a French report target and a German rendering user, confirming that the requested report language takes precedence. The checks also confirmed that missing or empty report data retains the environment language and that the full and small childpack layouts share the localized no-photo branch.
What T-Rex did
Reviews (2): Last reviewed commit: "[T3434] FIX: close the parenthesis in th..." | Re-trigger Greptile |
ecino
requested changes
Sep 3, 2026
Co-authored-by: ecino <ecino@users.noreply.github.com>
ecino
approved these changes
Sep 3, 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
Companion PR in compassion-switzerland (mini childpack note + paper tray selection): CompassionCH/compassion-switzerland#1812.
When a childpack was sent to the printer ("Print background" unchecked), it always came out in the language of the user's interface (typically English) instead of the language selected in the wizard the downloaded PDF was correct, only the printed one was wrong. Additionally, when a child has no photo yet, the childpack should say so in the selected language instead of leaving an empty frame.
Technical aspect
child_compassion/models/ir_actions_report.py, new): QWeb unconditionally overwrites thelangrendering value with the environment language (ir.qweb._prepare_environment). The wizard's language travels correctly in the reportdata, butbase_report_to_printer'sprint_documentrenders from the user's own environment, so the selected language was lost at rendering time. The new_render_qweb_htmloverride aligns the environment language withdata["lang"]for all childpack reports, they are recognised by their rendering model inheritingreport.child_compassion.childpack_full, so the Swiss Mini childpack is covered too (its template has not-langat all).report/childpack.xml): the photo frame of the full and small childpacks now shows a translated note ("No photo registered for this child") when the child has no fullshot. Translations added to the fr_CH/de/it.pofiles.Misc