[FIX] account_payment_order: column "payment_order_type" does not exist during migration to 9.0 (#471)

This commit is contained in:
Guillaume Masson
2018-06-05 14:21:44 +02:00
committed by Pedro M. Baeza
parent 2e9b0620ed
commit 22c9fbc14a

View File

@@ -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