server-ux/base_tier_validation/migrations/11.0.1.2.0/post-migrate.py

17 lines
487 B
Python
Raw Permalink Normal View History

2021-03-23 19:38:33 +00:00
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib.openupgrade import migrate
@migrate()
def migrate(env, version):
module_ids = env['ir.module.module'].search([
('name', '=', 'base_tier_validation_formula'),
('state', '=', 'uninstalled')
])
if module_ids:
module_ids.sudo().button_install()
cr = env.cr
cr.execute("UPDATE tier_definition SET definition_type = 'formula'")