mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user