Merge PR #544 into 13.0

Signed-off-by lmignon
pull/547/head
OCA-git-bot 2021-10-14 07:00:36 +00:00
commit a4f2138478
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
openupgrade.logged_query(
env.cr, """SELECT id, py3o_template_data FROM py3o_template"""
)
templates = env.cr.fetchall()
for template_id, data in templates:
template = env["py3o.template"].browse(template_id)
template.write({"py3o_template_data": bytes(data)})