mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user