Skip to content

Commit

Permalink
Merge PR #759 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by jbaudoux
  • Loading branch information
OCA-git-bot committed Nov 10, 2023
2 parents 8827b9b + 1f06f5f commit db3d0fc
Showing 1 changed file with 11 additions and 9 deletions.
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

0 comments on commit db3d0fc

Please sign in to comment.