diff --git a/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.py b/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.py index 7bd8d704fda..15d9a12bc65 100644 --- a/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.py +++ b/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.py @@ -220,7 +220,7 @@ def get_serial_nos(doctype, txt, searchfield, start, page_len, filters): def get_batch_nos(doctype, txt, searchfield, start, page_len, filters): query_filters = {} - if txt: + if filters.get("voucher_no") and txt: query_filters["batch_no"] = ["like", f"%{txt}%"] if filters.get("voucher_no"): @@ -239,5 +239,8 @@ def get_batch_nos(doctype, txt, searchfield, start, page_len, filters): ) else: + if txt: + query_filters["name"] = ["like", f"%{txt}%"] + query_filters["item"] = filters.get("item_code") return frappe.get_all("Batch", filters=query_filters, as_list=True)