From d988c7bd0698e2e300681384bcff847dd7d072bc Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 05:21:17 +0530 Subject: [PATCH] fix: Unknown column 'tabBatch.batch_no' in 'where clause' (backport #41418) (#41444) fix: Unknown column 'tabBatch.batch_no' in 'where clause' (#41418) fix: unknown column 'tabBatch.batch_no' in 'where clause' (cherry picked from commit 6bd13d745238ef3f6199a210f9b5cac5cc4025dc) Co-authored-by: rohitwaghchaure --- .../serial_and_batch_summary/serial_and_batch_summary.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)