bank-payment/account_banking_mandate/migrations/11.0.2.0.0/post-migration.py
2021-03-23 20:28:51 +01:00

15 lines
514 B
Python

# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openupgradelib import openupgrade
from openupgradelib import openupgrade_90
@openupgrade.migrate(use_env=True)
def migrate(env, version):
column = openupgrade.get_legacy_name('scan')
if openupgrade.column_exists(env.cr, 'account_banking_mandate', column):
openupgrade_90.convert_binary_field_to_attachment(
env, {'account.banking.mandate': [('scan', None)]},
)