File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
openupgrade_scripts/scripts/stock/17.0.1.1 Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1313}
1414
1515
16+ def _pre_stock_picking_picking_properties (env ):
17+ """Avoid triggering the computed method"""
18+ openupgrade .logged_query (
19+ env .cr ,
20+ """
21+ ALTER TABLE stock_picking
22+ ADD COLUMN IF NOT EXISTS picking_properties jsonb
23+ """ ,
24+ )
25+
26+
27+ def _pre_stock_picking_picking_properties (env ):
28+ """Avoid triggering the computed method"""
29+ openupgrade .logged_query (
30+ env .cr ,
31+ """
32+ ALTER TABLE stock_move_line
33+ ADD COLUMN IF NOT EXISTS picked boolean
34+ """ ,
35+ )
36+ openupgrade .logged_query (
37+ env .cr ,
38+ """
39+ UPDATE stock_move_line
40+ SET picked = True
41+ WHERE state = 'done';
42+ """ ,
43+ )
44+
45+
1646def fix_move_line_quantity (env ):
1747 """
1848 v17 combines what used to be reserved_qty and qty_done.
@@ -40,4 +70,6 @@ def fix_move_line_quantity(env):
4070def migrate (env , version ):
4171 openupgrade .rename_fields (env , _field_renames )
4272 openupgrade .copy_columns (env .cr , _column_copies )
73+ _pre_stock_picking_picking_properties (env )
74+ _pre_stock_picking_picking_properties (env )
4375 fix_move_line_quantity (env )
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ stock / stock.move.line / quantity (float) : NEW ha
4545# DONE: pre-migration
4646
4747stock / stock.move.line / picked (boolean) : NEW hasdefault: compute
48+ # DONE: pre-migration: Pre-create the column for avoiding triggering the compute.
49+
4850stock / stock.move.line / quant_id (many2one) : NEW relation: stock.quant
4951stock / stock.move.line / quantity_product_uom (float) : NEW isfunction: function, stored
5052# NOTHING TO DO
@@ -66,7 +68,11 @@ stock / stock.picking / message_main_attachment_id (many2one):
6668stock / stock.picking / move_ids_without_package (one2many): is now stored
6769stock / stock.picking / move_ids_without_package (one2many): not a function anymore
6870stock / stock.picking / move_line_nosuggest_ids (one2many): DEL relation: stock.move.line
71+ # NOTHING TO DO
72+
6973stock / stock.picking / picking_properties (properties): NEW hasdefault: compute
74+ # DONE: pre-migration: Pre-create the column for avoiding triggering the compute.
75+
7076stock / stock.picking / rating_ids (one2many) : NEW relation: rating.rating
7177stock / stock.picking / show_operations (boolean) : not a function anymore
7278stock / stock.picking / show_operations (boolean) : now related
You can’t perform that action at this time.
0 commit comments