Merge pull request #499 from hbrunn/9.0-account_payment_mode-set-payment_type-in-migration

[FIX] [account_payment_order] set payment_type for payment modes with newly assigned payment method
This commit is contained in:
Pedro M. Baeza
2018-08-21 13:53:20 +02:00
committed by GitHub

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)