mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: serial / batch barcode scanner (#39114)
(cherry picked from commit f09e2130a1)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -591,6 +591,13 @@ def scan_barcode(search_value: str) -> BarcodeScanResult:
|
||||
as_dict=True,
|
||||
)
|
||||
if batch_no_data:
|
||||
if frappe.get_cached_value("Item", batch_no_data.item_code, "has_serial_no"):
|
||||
frappe.throw(
|
||||
_(
|
||||
"Batch No {0} is linked with Item {1} which has serial no. Please scan serial no instead."
|
||||
).format(search_value, batch_no_data.item_code)
|
||||
)
|
||||
|
||||
_update_item_info(batch_no_data)
|
||||
set_cache(batch_no_data)
|
||||
return batch_no_data
|
||||
|
||||
Reference in New Issue
Block a user