[OU-FIX] account_reconcile_oca: Avoid crash when coming from v15

When coming directly from v15, the field `reconcile_data`` doesn't
exist, so the migration scripts here will crash. The solution is to
check if the column exists and exit early if not.
pull/641/head
Pedro M. Baeza 2024-03-16 18:17:56 +01:00
parent 427bd8a04f
commit db62b6bb02
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,10 @@ from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
if not openupgrade.column_exists(
env.cr, "account_bank_statement_line", "reconcile_data"
):
return # coming directly from v15, so reconcile_data doesn't exist
# Due to the big change we did, we need to loose how data is stored
openupgrade.logged_query(
env.cr,