Repository navigation
[T3646] FIX: own layout for GMC S10 child letters, no translation over page 2's printed text - #2213
Conversation
…r page 2's printed text
|
tested on stage |
[Medium impact] The change reaches the S10 child-letter import, printing, and upgrade workflows. Fix the migration's per-letter matching before merging. Findings
Reviews (1) · Last reviewed commit: "[T3646] FIX: own layout for GMC S10 chil..." · Reviewed by Greptile |
| messages = env["gmc.message"].search([("content", "like", "-1S10-")]) | ||
| messages = messages.filtered(lambda m: m.action_id.model == "correspondence") | ||
| letter_ids = [ | ||
| int(letter_id) | ||
| for message in messages | ||
| for letter_id in (message.object_ids or str(message.object_id)).split(",") | ||
| if letter_id.strip().isdigit() |
There was a problem hiding this comment.
Migration changes unrelated letters. The search matches an entire message, then collects every ID in its
object_ids. But process_commkit supports a Responses batch and returns all its letter IDs. If a batch contains both S10 and ordinary L1 letters, ordinary L1 letters with page-2 translations also get moved to the S10 layout. Their valid page-2 translation area is removed, and their text moves to an extra page when composed. Parse each response's Template and match only its own letter before changing template_id.
Problem
Many child letters arrive on GMC's S10 stationery (
XX-C-1S10-2"Thanks!" card,XX-G-1S10-1activity sheet). Odoo only reads the layout digit from GMC's code, so these get the L1 layout. On this stationery, L1's page-2 translation box lands on printed text, so a translation that overflows page 1 is printed over it (e.g. letter 653407).Fix
B2S - S10: page 1 as L1, page 2 without a translation box, so the overflow goes to the additional translation page.json_to_datamaps GMC codes containing-1S10-to it.