Skip to content

Commit

Permalink
[FIX] stock: don't prepare pack operations when not everything is res…
Browse files Browse the repository at this point in the history
…erved 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.
  • Loading branch information
jco-odoo committed Nov 19, 2015
1 parent cb16d20 commit 1fa45fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/stock/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2328,6 +2328,8 @@ def check_recompute_pack_op(self, cr, uid, ids, context=None):
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)
Expand Down Expand Up @@ -2363,7 +2365,7 @@ def action_assign(self, cr, uid, ids, no_prepare=False, context=None):
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
Expand Down

0 comments on commit 1fa45fc

Please sign in to comment.