summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJignesh Rathod <jir@openerp.com>2015-06-22 10:34:16 +0530
committerYannick Tivisse <yti@odoo.com>2016-03-08 11:48:35 +0100
commitaa02465bbf21306d4643d4e8ccbb2f72334e5971 (patch)
treea2d63e5976d11d3db10c9b88d86c617c28cb3ce5
parent7ab4f6e6694ae043c488ed2bfbd522ccf5d9fea7 (diff)
[FIX] stock: Return a returned pick set the pack to 'Available'
1) Configure the warehouse "Your company" to pick-pack-ship operation (you'll need to activate the advance route on WH config + set up the correct process through the warehouse configuration wizard. 2) Create a SO with a product (on stock) and confirm it 3) Display the deliveries, you'll have 3 : pick, pack, ship 4) Take the pick, force availability if needed, and confirm it 5) Return the pick and validate (e.g. imagine you missed something like puting the lot, so you want to reverse the pick). 6) Go back to the SO, click to view the deliveries 7) You create another, new, pick here (which is correct). Take it and confirm it. 8) Look at the pack => his state is "Waiting another operation"... This is not good ! We should have it "Ready to transfer" (now "Available") because we just (re)confirm the pick operation. Odoo don't know he should make the next operation (pack) available.
-rw-r--r--addons/stock/wizard/stock_return_picking.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py
index 12ccadc416f..f77bd9eaacc 100644
--- a/addons/stock/wizard/stock_return_picking.py
+++ b/addons/stock/wizard/stock_return_picking.py
@@ -96,9 +96,10 @@ class stock_return_picking(osv.osv_memory):
returned_lines = 0
# Cancel assignment of existing chained assigned moves
+ return_moves = list(set(move.move_id for move in data_obj.browse(cr, uid, data['product_return_moves'], context=context)))
moves_to_unreserve = []
- for move in pick.move_lines:
- to_check_moves = [move.move_dest_id] if move.move_dest_id.id else []
+ for move in return_moves:
+ to_check_moves = [move.move_dest_id] if move.move_dest_id else []
while to_check_moves:
current_move = to_check_moves.pop()
if current_move.state not in ('done', 'cancel') and current_move.reserved_quant_ids: