From 1f0a77874255a0ea9a83fc261a795776e938d987 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 13 Oct 2016 14:45:42 +0200 Subject: [PATCH] [FIX] stock: reverse picking in several steps - Activate the receipt in two steps on the warehouse - Create a PO for a stockable product - Receive the product in Input zone - Receive the product in Stock - Reverse the move to Stock > products are back in Input - Reverse the move to Input You can't reserve quantities for this last move (from Input to Vendor). This is because a picking has been automatically created from the Input to Stock. Original move which is reversed: Input -> Stock When we reverse it, we don't want to send it back to Stock, so we need to check the destination location of the original move, not its location. opw-689206 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f0016b5cd1e..7fda28f85e6 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2132,7 +2132,7 @@ class stock_move(osv.osv): if rules: rule = push_obj.browse(cr, uid, rules[0], context=context) # Make sure it is not returning the return - if (not move.origin_returned_move_id or move.origin_returned_move_id.location_id.id != rule.location_dest_id.id): + if (not move.origin_returned_move_id or move.origin_returned_move_id.location_dest_id.id != rule.location_dest_id.id): push_obj._apply(cr, uid, rule, move, context=context) return True