Files
bank-statement-import/account_statement_import_online/migrations/14.0.3.0.0/post-migration.py
Pedro M. Baeza c8148fab79 [OU-FIX] account_statement_import_online: Conditional renaming + filling
As the changes for having online raw data have been made only on v12
and v14, people coming from v13 won't have this column populated on
the DB, so we need to be tolerant with that circumstance.
2022-10-22 11:30:43 +02:00

18 lines
623 B
Python

# Copyright 2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
column = openupgrade.get_legacy_name("online_raw_data")
if openupgrade.column_exists(env.cr, "account_bank_statement_line", column):
openupgrade.logged_query(
env.cr,
"UPDATE account_bank_statement_line SET raw_data={online_raw_data}".format(
online_raw_data=column,
),
)