Skip to content

[T3456] Follow the render's language, not the partner's stored one - #2153

Open
danpa32 wants to merge 1 commit into
18.0from
T3456-fix-donation-quality-test
Open

[T3456] Follow the render's language, not the partner's stored one#2153
danpa32 wants to merge 1 commit into
18.0from
T3456-fix-donation-quality-test

Conversation

@danpa32

@danpa32 danpa32 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

T3456 — Fix failing quality test: MyCompassion: donations

Follow-up to T3416-tax-receipt-donation-history/T3441-tax-receipt-signature-lang. compassion-switzerland, compassion-website, compassion-modules

Related PR

What changed

  1. Tax receipt renders in the viewer's interface language, not the partner's stored one (compassion-switzerland)
  2. Tax receipt overflowing to a second page (compassion-switzerland)
  • The signature <img> had no height/width cap (width: 40%, ~76mm) — capped to width: 45mm (matching anniversary_card.xml's own signature usage). Margin-left adjusted afterward too (was -15mm, pushing it into the page margin per user feedback - see below).
  • .body_text (the letter-body box) is hardcoded to min-height: 120mm whenever a signature is shown, forcing a large empty gap below "Best regards" even for the tax receipt's few short paragraphs. Added a compact_body flag (set only in tax_receipt.xml) that skips this min-height, without touching the other, longer communications that share this template and rely on the fixed height.
  • Also trimmed tax_receipt_content's four stacked <br/> before the intro heading down to one.
  1. Language mismatch on the child gift payment slip (compassion-switzerland)
  2. Pager spacing on the donation history list (compassion-website)
  3. Stale/corrupted "Date" column header in donation history (compassion-website) — DB-only fix, no commit

How to test manually

  • Donations page (/my2/donations): download the tax receipt while browsing in different interface languages — the whole PDF (logo, salutation, date, body text, signature) should consistently follow whichever language you're browsing in.
  • Once report_compassion can be upgraded again: download a gift payment slip for a sponsored child while browsing in a language different from the partner's stored profile language — labels and the child/gift communication line should match.
  • Check the tax receipt PDF is one page, with reasonable spacing between the closing text and the signature.
  • Check the "Date" column header in donation history reads correctly in French (already fixed at the DB level locally; will need the same -u --i18n-overwrite sync — or .po was already correct so a normal deploy pipeline that runs migrations properly should pick it up fine).
  • Check spacing between the donation history rows and the Prev/Next pager.

_compute_address (salutation title, e.g. Mme/Frau/Signora) and
_compute_date_communication (the letter's date line) both derived
their language from partner.lang regardless of what language the
document is actually being rendered in - producing the same class of
mismatch fixed on the report_compassion side of this ticket (e.g. a
French tax receipt still showing "Frau" and a German-formatted date).
Read the language from context instead, falling back to partner.lang
only when no context language is set, and mark both computes
@api.depends_context("lang") so they aren't cached across
different-language renders of the same partner.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

Not safe to merge until Swiss tax receipts retain the requested render language for their address and date.

Findings

  1. P1 Swiss receipts ignore viewer language

Reviews (1) · Last reviewed commit: "[T3456] Follow the render's language, no..."

Comment thread thankyou_letters/models/res_partner.py
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.

1 participant