Skip to content

[OU-FIX] loyalty: pre-migrate stale _get_mail_partner in stored mail.template.lang#78

Open
dnplkndll wants to merge 3 commits into
19.0from
19.0-mig-loyalty-pre-migration
Open

[OU-FIX] loyalty: pre-migrate stale _get_mail_partner in stored mail.template.lang#78
dnplkndll wants to merge 3 commits into
19.0from
19.0-mig-loyalty-pre-migration

Conversation

@dnplkndll

Copy link
Copy Markdown

Migration work on the ledoent/OpenUpgrade fork (internal review). Rebased onto current 19.0.

The 18.0 loyalty mail_template_gift_card and mail_template_loyalty_card
both store lang as {{ object._get_mail_partner().lang }}. The method
was renamed to _get_mail_author in 19.0 — when the 19.0 module update
re-renders lang during data load, it raises AttributeError and aborts
the migration at loyalty/data/mail_template_data.xml:3 before the
existing post-migration (which nulls lang) ever runs.

Pre-migration is the only safe place to fix this; rename in place via
REPLACE so the rendering check passes and the existing post-migration
(or any user customization of lang) keeps working.

@dnplkndll dnplkndll force-pushed the 19.0-mig-loyalty-pre-migration branch 4 times, most recently from 46ce1c3 to 3ff9c2e Compare May 30, 2026 03:16
@dnplkndll dnplkndll force-pushed the 19.0-mig-loyalty-pre-migration branch 2 times, most recently from 443d4fb to 49d0b1e Compare June 5, 2026 19:53
@dnplkndll dnplkndll force-pushed the 19.0-mig-loyalty-pre-migration branch 3 times, most recently from c7e69d5 to a6d3851 Compare June 17, 2026 12:44
…l.template.lang

The 18.0 loyalty `mail_template_gift_card` and `mail_template_loyalty_card`
both store `lang` as `{{ object._get_mail_partner().lang }}`. The method
was renamed to `_get_mail_author` in 19.0 — when the 19.0 module update
re-renders `lang` during data load, it raises AttributeError and aborts
the migration at `loyalty/data/mail_template_data.xml:3` before the
existing post-migration (which nulls `lang`) ever runs.

Pre-migration is the only safe place to fix this; rename in place via
REPLACE so the rendering check passes and the existing post-migration
(or any user customization of `lang`) keeps working.
The helper returned partner_id (the recipient); mapping it to
_get_mail_author swapped the company/internal user into custom templates'
lang (customer emails switch to company language) — and only core
templates get reset by the module update. Rewrite to object.partner_id
across the stored template columns that can carry the call.
@dnplkndll dnplkndll force-pushed the 19.0-mig-loyalty-pre-migration branch from a6d3851 to e1c2372 Compare June 19, 2026 11:59
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