def migrate(cr, version): openupgrade.rename_columns(cr, column_renames) openupgrade.rename_xmlids(cr, xmlid_renames) openupgrade.rename_models(cr, [('survey', 'survey.survey'),('survey.answer','survey.label')]) openupgrade.rename_tables(cr, [('survey', 'survey_survey'),('survey_answer','survey_label')]) cr.execute("ALTER TABLE survey_page DROP CONSTRAINT IF EXISTS {}".format('survey_page_survey_id_fkey')) cr.execute("ALTER TABLE survey_question DROP CONSTRAINT IF EXISTS {}".format('survey_answer_question_id_fkey'))
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'; """)
def migrate(cr, version): openupgrade.rename_columns(cr, column_renames) openupgrade.rename_xmlids(cr, xmlid_renames) initialize_location_inventory(cr) openupgrade.rename_tables(cr, [('stock_inventory_move_rel', None)]) create_stock_picking_fields(cr) create_stock_move_fields(cr)
def migrate(cr, version): openupgrade.rename_columns(cr, column_renames) openupgrade.rename_xmlids(cr, xmlid_renames) initialize_location_inventory(cr) openupgrade.rename_tables(cr, [('stock_inventory_move_rel', None)]) have_procurement = openupgrade.column_exists( cr, 'product_template', openupgrade.get_legacy_name('procure_method')) if have_procurement: swap_procurement_move_rel(cr)
def migrate(cr, version): if not openupgrade.is_module_installed(cr, 'crm'): logger.info( "sales_team pre-migration skipped, because crm is not installed") return openupgrade.rename_xmlids(cr, xmlid_renames) # Test fixup: there is a demo section in 7.0 with the same code as a # section that is included in this module, violating the uniqueness # constraint. cr.execute("UPDATE crm_case_section SET code = '_DM' WHERE code = 'DM'")
def migrate(cr, version): openupgrade.rename_models(cr, [ ('crm.case.channel', 'crm.tracking.medium'), ('crm.case.resource.type', 'crm.tracking.campaign'), ]) openupgrade.rename_columns(cr, column_renames) openupgrade.rename_tables( cr, [('crm_case_channel', 'crm_tracking_medium'), ('crm_case_resource_type', 'crm_tracking_campaign')]) for constraint in ['crm_lead_channel_id_fkey', 'crm_lead_type_id_fkey']: cr.execute("ALTER TABLE crm_lead DROP CONSTRAINT IF EXISTS {}".format( constraint)) openupgrade.rename_xmlids(cr, xmlids)
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' ])
def migrate(cr, version): openupgrade.rename_xmlids(cr, xmlid_renames)
def migrate(cr, version): openupgrade.rename_xmlids(cr, xmlid_renames) openupgrade.rename_columns(cr, column_renames)
def migrate(cr, version): openupgrade.rename_columns(cr, column_renames) drop_report_mrp_view(cr) openupgrade.rename_tables(cr, table_spec) check_production_state(cr) openupgrade.rename_xmlids(cr, xmlid_renames)
def migrate(cr, version): openupgrade.rename_columns(cr, column_renames) openupgrade.rename_xmlids(cr, xmlid_renames) openupgrade.delete_model_workflow(cr, 'procurement.order')
def migrate(cr, version): openupgrade.rename_columns(cr, column_renames) openupgrade.rename_xmlids(cr, xmlid_renames) pool = pooler.get_pool(cr.dbname) copy_properties(cr, pool)