Skip to content

Commit

Permalink
shopfloor: apply zero_check only if product is not a consumable
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr committed Feb 23, 2024
1 parent c114af4 commit c4bb12f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions shopfloor/services/cluster_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,11 @@ def scan_destination_pack(self, picking_batch_id, move_line_id, barcode, quantit
qty_done=quantity,
)
move_line.write({"qty_done": quantity, "result_package_id": bin_package.id})

zero_check = move_line.picking_id.picking_type_id.shopfloor_zero_check
# Only apply zero check if the product is not a consumable.
zero_check = (
move_line.product_id.type != "consu"
and move_line.picking_id.picking_type_id.shopfloor_zero_check
)
if zero_check and move_line.location_id.planned_qty_in_location_is_empty():
return self._response_for_zero_check(batch, move_line)

Expand Down
12 changes: 10 additions & 2 deletions shopfloor/services/zone_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,11 @@ def _set_destination_location(

location_changed = True
# Zero check
zero_check = self.picking_type.shopfloor_zero_check
# Only apply zero check if the product is not a consumable.
zero_check = (
move_line.product_id.type != "consu"
and self.picking_type.shopfloor_zero_check
)
if zero_check and move_line.location_id.planned_qty_in_location_is_empty():
response = self._response_for_zero_check(move_line)
return (location_changed, response)
Expand Down Expand Up @@ -1042,7 +1046,11 @@ def _set_destination_package(self, move_line, quantity, package):
return (package_changed, response)
package_changed = True
# Zero check
zero_check = self.picking_type.shopfloor_zero_check
# Only apply zero check if the product is not a consumable.
zero_check = (
move_line.product_id.type != "consu"
and self.picking_type.shopfloor_zero_check
)
if zero_check and move_line.location_id.planned_qty_in_location_is_empty():
response = self._response_for_zero_check(move_line)
return (package_changed, response)
Expand Down

0 comments on commit c4bb12f

Please sign in to comment.