Exemple #1
0
def migrate(cr, version):
    # Drop view that inhibits changing field types. It will be recreated BTW
    cr.execute('drop view if exists report_document_user cascade')

    openupgrade.update_module_names(
        cr, apriori.renamed_modules.iteritems()
    )
    openupgrade.rename_xmlids(cr, xml_ids)
    openupgrade.check_values_selection_field(
        cr, 'ir_act_report_xml', 'report_type',
        ['controller', 'pdf', 'qweb-html', 'qweb-pdf', 'sxw', 'webkit'])
    openupgrade.check_values_selection_field(
        cr, 'ir_ui_view', 'type', [
            'calendar', 'diagram', 'form', 'gantt', 'graph', 'kanban',
            'qweb', 'search', 'tree'])
    
    # The tables stock.picking.in and stock.picking.out are merged into 
    # stock.picking
    openupgrade.logged_query(
        cr, """
        UPDATE ir_attachment
        SET res_model = 'stock.picking'
        WHERE res_model in ('stock.picking.in', 'stock.picking.out');
        """)
    
    # Product.template is used for non variant product in v7 this was
    # product.product
    openupgrade.logged_query(
        cr, """
        UPDATE ir_attachment
        SET res_model = 'product.template'
        WHERE res_model = 'product.product';
        """)
Exemple #2
0
def migrate(cr, version):
    openupgrade.check_values_selection_field(
        cr, 'ir_act_report_xml', 'report_type',
        ['controller', 'pdf', 'qweb-html', 'qweb-pdf', 'sxw', 'webkit'])
    openupgrade.check_values_selection_field(cr, 'ir_ui_view', 'type', [
        'calendar', 'diagram', 'form', 'gantt', 'graph', 'kanban', 'qweb',
        'search', 'tree'
    ])
def migrate(cr, version):
    # Drop view that inhibits changing field types. It will be recreated BTW
    cr.execute('drop view if exists report_document_user cascade')

    openupgrade.update_module_names(cr, apriori.renamed_modules.iteritems())
    openupgrade.rename_xmlids(cr, xml_ids)
    openupgrade.check_values_selection_field(
        cr, 'ir_act_report_xml', 'report_type',
        ['controller', 'pdf', 'qweb-html', 'qweb-pdf', 'sxw', 'webkit'])
    openupgrade.check_values_selection_field(cr, 'ir_ui_view', 'type', [
        'calendar', 'diagram', 'form', 'gantt', 'graph', 'kanban', 'qweb',
        'search', 'tree'
    ])
Exemple #4
0
def check_production_state(cr):
    """Check if a record with a state that is no longer supported
    (picking_except) exists in mrp_production and adjust it (to draft).
    """
    if openupgrade.check_values_selection_field(
            cr, 'mrp_production', 'state',
        ['cancel', 'confirmed', 'done', 'draft', 'in_production', 'ready']):
        # if selection value doesn't exist, perform nothing
        return
    # Set picking_except to draft
    sql = """
        SELECT id
        FROM mrp_production
        WHERE state = 'picking_except'"""
    cr.execute(sql)
    prod_ids = tuple([x for x, in tuple(cr.fetchall())])
    sql = """
        UPDATE mrp_production
        SET state = 'draft'
        WHERE id in %s"""
    openupgrade.logged_query(cr, sql, (tuple(prod_ids), ))
Exemple #5
0
def migrate(cr, version):
    openupgrade.check_values_selection_field(
        cr, 'ir_act_report_xml', 'report_type',
        ['controller', 'pdf', 'qweb-html', 'qweb-pdf', 'sxw', 'webkit'])
    openupgrade.rename_columns(cr, column_renames)