How to use the openupgradelib.openupgrade.logged_query 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 beescoop / Obeesdoo / beesdoo_shift / migrations / 12.0.1.0.0 / pre-migration.py View on Github external
def rename_config_parameters(cr, keys_spec):
    for (old, new) in keys_spec:
        query = ("UPDATE ir_config_parameter SET key = %s "
                 "WHERE key = %s")
        openupgrade.logged_query(cr, query, (new, old))
github ForgeFlow / stock-rma / rma / post_init_hook.py View on Github external
def set_type(cr):
    query = """
        update rma_order
        set type = 'customer'
        where %s = 1
    """ % (openupgrade.get_legacy_name('claim_type'))
    openupgrade.logged_query(cr, query)
    query = """
        update rma_order
        set type = 'supplier'
        where %s = 2
    """ % (openupgrade.get_legacy_name('claim_type'))
    openupgrade.logged_query(cr, query)
    query = """
        update rma_order_line rml set type = ro.type
        from rma_order ro
        where ro.id = rml.rma_id
    """
    openupgrade.logged_query(cr, query)
github ForgeFlow / stock-rma / rma / post_init_hook.py View on Github external
def set_policies(cr):
    query = """
        update rma_order_line rml
        set receipt_policy = 'ordered'
        from rma_order ro
        where %s is not null
    """ % (openupgrade.get_legacy_name('move_in_id'))
    openupgrade.logged_query(cr, query)
    query = """
        update rma_order_line rml
        set receipt_policy = 'no'
        from rma_order ro
        where %s is null
    """ % (openupgrade.get_legacy_name('move_in_id'))
    openupgrade.logged_query(cr, query)

    query = """
        update rma_order_line rml
        set delivery_policy = 'ordered'
        from rma_order ro
        where %s is not null
    """ % (openupgrade.get_legacy_name('move_out_id'))
    openupgrade.logged_query(cr, query)
    query = """
        update rma_order_line rml
        set delivery_policy = 'no'
        from rma_order ro
        where %s is null
    """ % (openupgrade.get_legacy_name('move_out_id'))
    openupgrade.logged_query(cr, query)
github ForgeFlow / stock-rma / rma_account / migrations / 9.0.1.0.0 / post-migration.py View on Github external
update rma_order_line rml
        set refund_policy = 'ordered'
        from rma_order ro
        where refund_line_id is not null
        and rml.%s = ro.id
    """ % (openupgrade.get_legacy_name('claim_id'))
    openupgrade.logged_query(cr, query)

    query = """
        update rma_order_line rml
        set refund_policy = 'no'
        from rma_order ro
        where refund_line_id is null
        and rml.%s = ro.id
    """ % (openupgrade.get_legacy_name('claim_id'))
    openupgrade.logged_query(cr, query)
github ForgeFlow / stock-rma / rma_account / migrations / 9.0.1.0.0 / post-migration.py View on Github external
def link_refunds(cr):
    query = """
    update account_invoice_line ail set rma_line_id = null;
    """
    openupgrade.logged_query(cr, query)
    query = """
        update account_invoice_line ail
        set rma_line_id = rol.id
        from rma_order ro
        inner join rma_order_line rol on rol.rma_id = ro.id
        where rol.%s = ro.id
        and rol.%s = ail.id
    """ % (openupgrade.get_legacy_name('claim_id'),
           openupgrade.get_legacy_name('refund_line_id'))
    openupgrade.logged_query(cr, query)
github ForgeFlow / stock-rma / rma / post_init_hook.py View on Github external
def link_moves(cr):
    query = """
        update stock_move stm
        set rma_line_id = rol.id
        from rma_order_line rol
        inner join rma_order on rol.%s = rma_order.id
        where rol.%s = stm.id
    """ % (openupgrade.get_legacy_name('claim_id'),
           openupgrade.get_legacy_name('move_out_id'))
    openupgrade.logged_query(cr, query)
    query = """
        update stock_move stm
        set rma_line_id = rol.id
        from rma_order_line rol
        inner join rma_order on rol.%s = rma_order.id
        where rol.%s = stm.id
    """ % (openupgrade.get_legacy_name('claim_id'),
           openupgrade.get_legacy_name('move_in_id'))
    openupgrade.logged_query(cr, query)
github ingadhoc / odoo-support / adhoc_modules / migrations / 9.0.1.4.0 / pre-migration.py View on Github external
def migrate(cr, version):
    openupgrade.logged_query(cr, """
        DELETE FROM ir_ui_view where model = 'db.configuration'
github OCA / timesheet / hr_timesheet_sheet_period / migrations / 12.0.2.0.0 / post-upgrade.py View on Github external
def migrate(env, version):
    openupgrade.logged_query(
        env.cr,
        """
        UPDATE res_company
github ForgeFlow / stock-rma / rma_account / migrations / 9.0.1.0.0 / post-migration.py View on Github external
def link_refunds(cr):
    query = """
    update account_invoice_line ail set rma_line_id = null;
    """
    openupgrade.logged_query(cr, query)
    query = """
        update account_invoice_line ail
        set rma_line_id = rol.id
        from rma_order ro
        inner join rma_order_line rol on rol.rma_id = ro.id
        where rol.%s = ro.id
        and rol.%s = ail.id
    """ % (openupgrade.get_legacy_name('claim_id'),
           openupgrade.get_legacy_name('refund_line_id'))
    openupgrade.logged_query(cr, query)