[FIX-OU] report_py3o: Missing migration script

This commit is contained in:
Enric Tobella
2021-10-03 15:17:56 +02:00
parent 74ae606fa1
commit 1b9f34baad

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)})