Skip to content

Commit

Permalink
location transfer bknd: rollback move lines and fail if not assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
simahawk authored and sebalix committed Jul 16, 2020
1 parent b1160a9 commit f0b066c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions shopfloor/services/location_content_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ def scan_location(self, barcode):
new_moves = self._create_moves_from_location(location)
new_moves._action_confirm(merge=False)
new_moves._action_assign()
if not all([x.state == "assigned" for x in new_moves]):
new_moves._action_cancel()
return self._response_for_start(
message={
"message_type": "error",
"body": _("New move lines cannot be assigned: canceled."),
}
)
pickings = new_moves.mapped("picking_id")
move_lines = new_moves.move_line_ids

Expand Down

0 comments on commit f0b066c

Please sign in to comment.