Skip to content
Draft
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions shopfloor/services/cluster_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,13 @@ def scan_line(self, picking_batch_id, move_line_id, barcode, sublocation_id=None
have to precise what they want by scanning one of:

* pack
* product
* lot
* product


The result must be unambigous. For instance if we scan a product but the
product is tracked by lot, scanning the lot has to be required.
product is tracked by lot, scanning the lot has to be required. We support
multi valued barcodes (like GS1) if lot is provided along with product.

`sublocation_id` is used when the scan_location_or_pack_first option is
switched on and the location contains multiple products with no lot or package.
Expand Down Expand Up @@ -488,6 +490,9 @@ def scan_line(self, picking_batch_id, move_line_id, barcode, sublocation_id=None

product = search.product_from_scan(barcode)
if product and move_line.product_id == product:
lot = search.lot_from_scan(barcode, products=move_line.product_id)
if lot and move_line.lot_id == lot:
return self._scan_line_by_lot(picking, move_line, lot, sublocation)
return self._scan_line_by_product(picking, move_line, product, sublocation)

packaging = search.packaging_from_scan(barcode)
Expand Down
2 changes: 1 addition & 1 deletion shopfloor/services/location_content_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,9 @@ def scan_line(self, location_id, move_line_id, barcode):
search = self._actions_for("search")
handlers = {
"package": self._scan_line__by_package,
"lot": self._scan_line__by_lot,
"product": self._scan_line__by_product,
"packaging": self._scan_line__by_packaging,
"lot": self._scan_line__by_lot,
"none": self._scan_line__fallback,
}
try:
Expand Down
Loading