Skip to content

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

Draft
dnplkndll wants to merge 1 commit into
OCA:19.0from
ledoent:19.0-mig-loyalty-pre-migration
Draft

[19.0][OU-FIX] loyalty: pre-migrate stale _get_mail_partner in stored mail.template.lang#5666
dnplkndll wants to merge 1 commit into
OCA:19.0from
ledoent:19.0-mig-loyalty-pre-migration

Conversation

@dnplkndll
Copy link
Copy Markdown

@dnplkndll dnplkndll commented May 21, 2026

Follow-up to #5629 (merged 2026-05-15). That PR's post-migration.py is
the correct intent but the wrong phase: the data-load template render
aborts before post-migration runs, so the existing fix never actually
fires. Move the cleanup to pre-migration via SQL REPLACE, which also
preserves any user customization of lang that the post-migration's
unconditional lang=False would otherwise discard.

@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels May 21, 2026
…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.
@dnplkndll dnplkndll force-pushed the 19.0-mig-loyalty-pre-migration branch from 86d4308 to f7abc74 Compare May 22, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants