Skip to content

Commit

Permalink
shopfloor_reception: fix lock on move when done
Browse files Browse the repository at this point in the history
  • Loading branch information
TDu committed Nov 15, 2023
1 parent 333b1db commit d76aabc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shopfloor_reception/services/reception.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,12 @@ def _auto_post_line(self, selected_line):
lambda line: line.state not in ("cancel", "done")
and line.product_uom_qty > 0
)
move = selected_line.move_id
lock = self._actions_for("lock")
lock.for_update(move)
if lines_with_qty_todo:
lines_with_qty_todo.product_uom_qty = 0

move = selected_line.move_id
move_quantity = move.product_uom._compute_quantity(
move.product_uom_qty, selected_line.product_uom_id
)
Expand All @@ -1297,8 +1299,6 @@ def _auto_post_line(self, selected_line):
new_move._action_confirm(merge=False)
new_move._recompute_state()
new_move._action_assign()
lock = self._actions_for("lock")
lock.for_update(move)
move._recompute_state()
new_move.extract_and_action_done()

Expand Down

0 comments on commit d76aabc

Please sign in to comment.