Do not pick product at the destination location

It is forbidden to create move with the same source and destination locations.
To avoid this case, we remove the destination location from the quantities to
pick.

issue7856
review66541002
This commit is contained in:
Cédric Krier
2019-02-18 18:34:32 +01:00
parent 105b69448d
commit e3b6c3559d
+2
View File
@@ -881,6 +881,8 @@ class Move(Workflow, ModelSQL, ModelView):
location_qties[location] = Uom.compute_qty(
move.product.default_uom, pbl[key], move.uom,
round=False)
# Prevent to pick from the destination location
location_qties.pop(move.to_location, None)
to_pick = move.pick_product(location_qties)