[FIX] set payment_type for payment modes with newly assigned payment method

This commit is contained in:
Holger Brunn
2018-08-21 12:29:21 +02:00
parent 2ea4cd22af
commit 372310dfd8

View File

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