mirror of
https://gitlab.com/flectra-community/reporting-engine.git
synced 2024-11-15 02:32:05 +00:00
18 lines
525 B
Python
18 lines
525 B
Python
|
# Copyright 2022 Tecnativa - Víctor Martínez
|
||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||
|
|
||
|
import re
|
||
|
|
||
|
from openupgradelib import openupgrade
|
||
|
|
||
|
|
||
|
@openupgrade.migrate()
|
||
|
def migrate(env, version):
|
||
|
"""In v15 mail engine is inline_template, we try to replace the following:
|
||
|
- ${object} > {{object}}
|
||
|
- ${user} > {{user}}
|
||
|
- ${ctx} > {{ctx}}
|
||
|
"""
|
||
|
for item in env["base.comment.template"].search([("text", "ilike", "${")]):
|
||
|
item.text = re.sub(r"\${(.+)}", r"{{\1}}", item.text)
|