diff --git a/docsource/modules180-190.rst b/docsource/modules180-190.rst index e7f797ce076..998d7e667d8 100644 --- a/docsource/modules180-190.rst +++ b/docsource/modules180-190.rst @@ -698,7 +698,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | link_tracker | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| loyalty | | | +| loyalty |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | lunch | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/loyalty/19.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/loyalty/19.0.1.0/pre-migration.py new file mode 100644 index 00000000000..3c5e6439bf1 --- /dev/null +++ b/openupgrade_scripts/scripts/loyalty/19.0.1.0/pre-migration.py @@ -0,0 +1,18 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + """Rename the removed ``_get_mail_partner`` helper to ``_get_mail_author`` + in the stored ``lang`` of these templates, as the 19.0 data-load render + aborts before the existing post-migration could clear the field. + """ + openupgrade.logged_query( + env.cr, + """ + UPDATE mail_template + SET lang = REPLACE(lang, '_get_mail_partner', '_get_mail_author') + WHERE model = 'loyalty.card' + AND lang LIKE '%%_get_mail_partner%%' + """, + )