mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] base_comment_template: Migration to 15.0
TT35696
This commit is contained in:
committed by
Jesús Alan Ramos Rodríguez
parent
61973247ec
commit
1a9d3178f1
@@ -0,0 +1,17 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user