From aa02465bbf21306d4643d4e8ccbb2f72334e5971 Mon Sep 17 00:00:00 2001 From: Jignesh Rathod Date: Mon, 22 Jun 2015 10:34:16 +0530 Subject: [PATCH] [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. --- addons/stock/wizard/stock_return_picking.py | 5 +++-- 1 file 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: