mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Merge pull request #450 from Tecnativa/9.0-PR-account_payment_mode
[9.0][MIG] account_payment_mode: Migration script for store related payment_type
This commit is contained in:
@@ -13,3 +13,12 @@ def migrate(env, version):
|
||||
# module and base_iban with this module
|
||||
if openupgrade.is_module_installed(env.cr, 'base_iban'):
|
||||
env['res.partner.bank'].search([])._compute_acc_type()
|
||||
|
||||
# Store payment_type in store related field
|
||||
openupgrade.logged_query(
|
||||
env.cr, """
|
||||
UPDATE account_payment_mode apm
|
||||
SET payment_type = pm.payment_type
|
||||
FROM account_payment_method pm WHERE apm.payment_method_id = pm.id
|
||||
WHERE payment_type IS NULL;
|
||||
""")
|
||||
|
||||
Reference in New Issue
Block a user