[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
This commit is contained in:
Nicolas Martinelli
2016-10-13 16:12:05 +02:00
parent c63c225274
commit 1f0a778742
+1 -1
View File
@@ -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