Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] shopfloor_reception: multiple moves with same product #759

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions shopfloor_reception/services/reception.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,20 +418,22 @@ def _scan_line__by_product__return(self, picking, product):
return self._scan_line__find_or_create_line(picking, return_move)

def _scan_line__by_product(self, picking, product):
move = picking.move_lines.filtered(lambda m: m.product_id == product)
moves = picking.move_lines.filtered(lambda m: m.product_id == product)
# Only create a return if don't already have a maching reception move
if not move and self.work.menu.allow_return:
if not moves and self.work.menu.allow_return:
response = self._scan_line__by_product__return(picking, product)
if response:
return response
# Otherwise, the picking isn't a return, and should be a regular reception
message = self._check_move_available(move, "product")
if message:
return self._response_for_select_move(
picking,
message=message,
)
return self._scan_line__find_or_create_line(picking, move)
message = not moves and self._check_move_available(moves, "product")
for move in moves:
message = self._check_move_available(move, "product")
if not message:
return self._scan_line__find_or_create_line(picking, move)
return self._response_for_select_move(
picking,
message=message,
)

def _scan_line__by_packaging__return(self, picking, packaging):
search = self._actions_for("search")
Expand Down
Loading