Skip to content

Commit 50e164a

Browse files
committed
shopfloor: apply zero_check only if product is not a consumable
1 parent c114af4 commit 50e164a

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

shopfloor/services/cluster_picking.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,11 @@ def scan_destination_pack(self, picking_batch_id, move_line_id, barcode, quantit
776776
qty_done=quantity,
777777
)
778778
move_line.write({"qty_done": quantity, "result_package_id": bin_package.id})
779-
780-
zero_check = move_line.picking_id.picking_type_id.shopfloor_zero_check
779+
# Only apply zero check if the product is of type "product".
780+
zero_check = (
781+
move_line.product_id.type == "product"
782+
and move_line.picking_id.picking_type_id.shopfloor_zero_check
783+
)
781784
if zero_check and move_line.location_id.planned_qty_in_location_is_empty():
782785
return self._response_for_zero_check(batch, move_line)
783786

shopfloor/services/zone_picking.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,11 @@ def _set_destination_location(
959959

960960
location_changed = True
961961
# Zero check
962-
zero_check = self.picking_type.shopfloor_zero_check
962+
# Only apply zero check if the product is of type "product".
963+
zero_check = (
964+
move_line.product_id.type == "product"
965+
and self.picking_type.shopfloor_zero_check
966+
)
963967
if zero_check and move_line.location_id.planned_qty_in_location_is_empty():
964968
response = self._response_for_zero_check(move_line)
965969
return (location_changed, response)
@@ -1042,7 +1046,11 @@ def _set_destination_package(self, move_line, quantity, package):
10421046
return (package_changed, response)
10431047
package_changed = True
10441048
# Zero check
1045-
zero_check = self.picking_type.shopfloor_zero_check
1049+
# Only apply zero check if the product is of type "product".
1050+
zero_check = (
1051+
move_line.product_id.type == "product"
1052+
and self.picking_type.shopfloor_zero_check
1053+
)
10461054
if zero_check and move_line.location_id.planned_qty_in_location_is_empty():
10471055
response = self._response_for_zero_check(move_line)
10481056
return (package_changed, response)

0 commit comments

Comments
 (0)