[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.
This commit is contained in:
Josse Colpaert
2015-11-19 17:18:31 +01:00
parent cb16d20909
commit 1fa45fcfff
+3 -1
View File
@@ -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