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 27, 2023
1 parent ee88c38 commit 92d3b33
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 @@ -1283,10 +1283,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 @@ -1299,8 +1301,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 92d3b33

Please sign in to comment.