Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docsource/modules180-190.rst
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ Module coverage 18.0 -> 19.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| link_tracker | |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| loyalty | | |
| loyalty |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| lunch | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
18 changes: 18 additions & 0 deletions openupgrade_scripts/scripts/loyalty/19.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -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%%'
""",
)
Loading