mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
As the field was not properly converted to property at 2.0.0, the script fails to do its job when migrating from v11, so we need to adapt the scripts to this situation.
14 lines
462 B
Python
14 lines
462 B
Python
# Copyright 2020 Tecnativa - Pedro M. Baeza
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
from openupgradelib import openupgrade
|
|
|
|
|
|
@openupgrade.migrate()
|
|
def migrate(env, version):
|
|
cr = env.cr
|
|
table = 'res_partner'
|
|
old_column = 'comment_template_id'
|
|
new_column = 'property_comment_template_id'
|
|
if openupgrade.column_exists(cr, table, old_column):
|
|
openupgrade.rename_columns(cr, {table: [(old_column, new_column)]})
|