diff --git a/openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/pre-migration.py new file mode 100644 index 000000000000..55925d52bb46 --- /dev/null +++ b/openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/pre-migration.py @@ -0,0 +1,26 @@ +from openupgradelib import openupgrade + + +def _sml_update_batch_id(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE stock_move_line + ADD COLUMN IF NOT EXISTS batch_id INTEGER + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE stock_move_line sml + SET batch_id = sp.batch_id + FROM stock_picking sp + WHERE sml.picking_id = sp.id + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + _sml_update_batch_id(env) + diff --git a/openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..8cbce96292da --- /dev/null +++ b/openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,22 @@ +---Models in module 'stock_picking_batch'--- +---Fields in module 'stock_picking_batch'--- +stock_picking_batch / stock.move.line / batch_id (many2one) : is now stored +# Done pre-migration: create column and fill value + +stock_picking_batch / stock.picking.type / auto_batch (boolean) : NEW +stock_picking_batch / stock.picking.type / batch_auto_confirm (boolean) : NEW hasdefault: default +stock_picking_batch / stock.picking.type / batch_group_by_dest_loc (boolean): NEW +stock_picking_batch / stock.picking.type / batch_group_by_destination (boolean): NEW +stock_picking_batch / stock.picking.type / batch_group_by_partner (boolean): NEW +stock_picking_batch / stock.picking.type / batch_group_by_src_loc (boolean): NEW +stock_picking_batch / stock.picking.type / batch_max_lines (integer) : NEW +stock_picking_batch / stock.picking.type / batch_max_pickings (integer) : NEW +# NOTHING TO Do + +---XML records in module 'stock_picking_batch'--- +NEW ir.ui.view: stock_picking_batch.stock_move_line_view_search_inherit_stock_picking_batch +NEW ir.ui.view: stock_picking_batch.stock_picking_form_inherit +NEW ir.ui.view: stock_picking_batch.view_move_line_tree_inherit_stock_picking_batch +NEW ir.ui.view: stock_picking_batch.view_picking_internal_search_inherit +NEW ir.ui.view: stock_picking_batch.view_picking_type_form_inherit +# NOTHING TO DO