From 1fa45fcfff8b3e214c3b358e4d03e17ed435577f Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 19 Nov 2015 11:16:26 +0100 Subject: [PATCH] [FIX] stock: don't prepare pack operations when not everything is reserved and delivery method is all at once When all the products need to be reserved before doing the picking, the pack operations were not shown, but still created. This is not necessary (and did not work as it tried to reserve according to existing pack operations), as you will need to reserve again when there is sufficient stock to put the picking in available state and then the pack operations will be generated and made visible. --- addons/stock/stock.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 292bcce1908..10105a83e7d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2328,6 +2328,8 @@ class stock_move(osv.osv): pickings_write = [] pick_obj = self.pool['stock.picking'] for pick in pickings: + if pick.state in ('waiting', 'confirmed'): #In case of 'all at once' delivery method it should not prepare pack operations + continue # Check if someone was treating the picking already if not any([x.qty_done > 0 for x in pick.pack_operation_ids]): pickings_partial.append(pick.id) @@ -2363,7 +2365,7 @@ class stock_move(osv.osv): else: todo_moves.append(move) - #we always keep the quants already assigned and try to find the remaining quantity on quants not assigned only + #we always search for yet unassigned quants main_domain[move.id] = [('reservation_id', '=', False), ('qty', '>', 0)] #if the move is preceeded, restrict the choice of quants in the ones moved previously in original move