bank-payment/account_banking_mandate/migrations/11.0.2.0.0/post-migration.py

15 lines
514 B
Python
Raw Permalink Normal View History

2021-03-23 19:28:51 +00:00
# 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)]},
)