forked from tvtma/OpenUpgrade
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] stock_picking_batch: migration to 16.0
related task: https://viindoo.com/web?debug=1#id=94182&cids=1&menu_id=89&action=409&active_id=490&model=project.task&view_type=form
- Loading branch information
1 parent
0642a19
commit f4ee8be
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
22 changes: 22 additions & 0 deletions
22
openupgrade_scripts/scripts/stock_picking_batch/16.0.1.0/upgrade_analysis_work.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |