diff --git a/account_payment_order/migrations/9.0.1.0.0/post-migration.py b/account_payment_order/migrations/9.0.1.0.0/post-migration.py index dba5b66d0..02ac34077 100644 --- a/account_payment_order/migrations/9.0.1.0.0/post-migration.py +++ b/account_payment_order/migrations/9.0.1.0.0/post-migration.py @@ -24,7 +24,10 @@ def map_payment_type(cr): @openupgrade.migrate(use_env=True) def migrate(env, version): cr = env.cr - map_payment_type(cr) + table = 'account_payment_order' + if (openupgrade.table_exists(cr, table) and + openupgrade.column_exists(cr, table, 'payment_order_type')): + map_payment_type(cr) cr.execute(""" UPDATE account_payment_order apo