summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosse Colpaert <jco@odoo.com>2015-11-19 11:16:26 +0100
committerJosse Colpaert <jco@odoo.com>2015-11-19 17:18:31 +0100
commit1fa45fcfff8b3e214c3b358e4d03e17ed435577f (patch)
treeeb131665e674176ad4557c5a19b211949bf015da
parentcb16d209093188d7a25133974640f8075fe7fbb0 (diff)
[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.
-rw-r--r--addons/stock/stock.py4
1 files changed, 3 insertions, 1 deletions
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