Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def migrate(cr, version):
"""Update database from previous versions, after updating module."""
openupgrade.rename_tables(
cr=cr, table_spec=[("locomotive_backend", "shopinvader_backend")]
)
openupgrade.rename_models(
cr=cr, model_spec=[("locomotive.backend", "shopinvader.backend")]
)
# remove blocking view
cr.execute(
"""DELETE FROM ir_ui_view
WHERE arch_db ilike '%locomotive_backend_ids%'"""
def pre_init_hook(cr):
env = Environment(cr, SUPERUSER_ID, {})
if not openupgrade.table_exists(env.cr, 'rma_order'):
openupgrade.copy_columns(env.cr, column_copies)
openupgrade.rename_columns(env.cr, column_renames)
openupgrade.rename_tables(env.cr, _table_renames)
assign_status(env.cr)
set_default_values(env.cr)