How to use the openupgradelib.openupgrade.migrate function in openupgradelib

To help you get started, we’ve selected a few openupgradelib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OCA / timesheet / hr_timesheet_sheet / migrations / 13.0.1.0.0 / pre-migration.py View on Github external
@openupgrade.migrate()
def migrate(env, version):
    openupgrade.rename_columns(env.cr, column_renames)
github ForgeFlow / stock-rma / rma_account / migrations / 9.0.1.0.0 / post-migration.py View on Github external
@openupgrade.migrate(use_env=True)
def migrate(env, version):
    set_policies(env.cr)
    link_refunds(env.cr)
github ingadhoc / odoo-public-administration / public_budget / migrations / 9.0.1.0.0 / post-migration.py View on Github external
@openupgrade.migrate(use_env=True)
def migrate(env, version):
    """
    El campo reference no lo tenemos en los payment groups, lo agregamos
    con sipreco. Odoo lo migro de los vouchers a payment_reference en odoo
    pero no se usa practicamente, lo movemos al campo que generamos para
    sipreco en payment group.
    Ademas, odoo lleva el campo name de voucher a name de payment pero si
    name en payment seria la secuencia y en realidad communication esta vacio,
    como usamos com.. para reemplazar name, copiamos names viejos a com..

    IMPORTANTE No buscamos por diario porque podria haber cambiado con cheques
    """
    correct_advance_account_types(env)
    cr = env.cr

    cr.execute("""
github ingadhoc / odoo-public-administration / public_budget / migrations / 9.0.1.17.0 / post-migration.py View on Github external
@openupgrade.migrate(use_env=True)
def migrate(env, version):
    """
    NOTA en realidad esto debería haber sido en un pre-upgrade para que
    odoo no los actualice en esta misma actualización
    """
    cr = env.cr

    cr.execute("""
        UPDATE ir_model_data set noupdate=True
github OCA / timesheet / hr_timesheet_sheet / migrations / 13.0.1.0.0 / post-migration.py View on Github external
@openupgrade.migrate()
def migrate(env, version):
    res_company_sheet_range_map_values(env)
github ingadhoc / odoo-support / adhoc_modules / migrations / 9.0.1.4.0 / pre-migration.py View on Github external
@openupgrade.migrate()
def migrate(cr, version):
    openupgrade.logged_query(cr, """
        DELETE FROM ir_ui_view where model = 'db.configuration'