fix: serial / batch barcode scanner (#39114)

This commit is contained in:
rohitwaghchaure
2024-01-04 14:58:02 +05:30
committed by GitHub
parent c2f88f29dc
commit f09e2130a1
6 changed files with 286 additions and 67 deletions

View File

@@ -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