diff --git a/account_payment_order/migrations/9.0.1.0.0/pre-migration.py b/account_payment_order/migrations/9.0.1.0.0/pre-migration.py index 1a256100b..f43d9f7cc 100644 --- a/account_payment_order/migrations/9.0.1.0.0/pre-migration.py +++ b/account_payment_order/migrations/9.0.1.0.0/pre-migration.py @@ -138,6 +138,15 @@ def migrate_payment_mode_types(env): WHERE type = %s""", (method.id, row[0]), ) + openupgrade.logged_query( + env.cr, + """UPDATE account_payment_mode + SET payment_type = account_payment_method.payment_type + FROM account_payment_method + WHERE account_payment_mode.payment_method_id=account_payment_method.id + AND account_payment_mode.payment_type is NULL + """ + ) @openupgrade.migrate(use_env=True)