From 336a56b28e07290ea390553057571804dfc2d415 Mon Sep 17 00:00:00 2001 From: Sergio Teruel Albert Date: Fri, 27 Oct 2017 11:13:49 +0200 Subject: [PATCH] [9.0][MIG] account_payment_mode: Migration script for force recompute account bank types --- .../migrations/9.0.1.0.0/post-migration.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 account_payment_mode/migrations/9.0.1.0.0/post-migration.py diff --git a/account_payment_mode/migrations/9.0.1.0.0/post-migration.py b/account_payment_mode/migrations/9.0.1.0.0/post-migration.py new file mode 100644 index 000000000..2e22d3c0c --- /dev/null +++ b/account_payment_mode/migrations/9.0.1.0.0/post-migration.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Sergio Teruel +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +@openupgrade.migrate(use_env=True) +def migrate(env, version): + if not version: + return + # Force recompute acc_type, issue with inheritance chain between base + # module and base_iban with this module + if openupgrade.is_module_installed(env.cr, 'base_iban'): + env['res.partner.bank'].search([])._compute_acc_type()