Skip to content

Commit

Permalink
[OU-FIX] account_reconcile_oca: Avoid crash when coming from v15
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pedrobaeza committed Mar 16, 2024
1 parent 427bd8a commit db62b6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions account_reconcile_oca/migrations/16.0.1.2.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

@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,
Expand Down

0 comments on commit db62b6b

Please sign in to comment.