Skip to content

Commit

Permalink
[MIG] stock_picking_batch: migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
duong77476-viindoo committed Jul 3, 2024
1 parent 0642a19 commit f4ee8be
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
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)

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

0 comments on commit f4ee8be

Please sign in to comment.