Skip to content

Commit

Permalink
Unreserve before moving the quant, to avoid problems on the picking t…
Browse files Browse the repository at this point in the history
…hat booked the quant
  • Loading branch information
alexis-via committed Feb 3, 2017
1 parent 3a9a879 commit 6d1fb8a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stock_quant_packages_moving_wizard/models/stock.py
Expand Up @@ -29,6 +29,12 @@ def _prepare_move_to(self, dest_location):

@api.one
def move_to(self, dest_location):
# if the quant is reserved for another move,
# we should cleanly un-reserve it first, so that
# the picking that booked this quant comes back from
# available to waiting availability
if self.reservation_id:
self.reservation_id.do_unreserve()
vals = self._prepare_move_to(dest_location)
new_move = self.env['stock.move'].create(vals)
# No group has write access on stock.quant -> we need sudo()
Expand Down

0 comments on commit 6d1fb8a

Please sign in to comment.