diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index ccd334ffba..0dcf077c47 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -152,6 +152,9 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False): conditions = [] + if not filters["item_group"]: + filters.pop("item_group", None) + description_cond = '' if frappe.db.count('Item', cache=True) < 50000: # scan description only if items are less than 50000 diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js index 07e5f4b3d7..120f879f20 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.js +++ b/erpnext/stock/report/stock_balance/stock_balance.js @@ -40,7 +40,10 @@ frappe.query_reports["Stock Balance"] = { "options": "Item", "get_query": function() { return { - query: "erpnext.controllers.queries.item_query" + query: "erpnext.controllers.queries.item_query", + filters: { + "item_group": frappe.query_report.get_filter_value("item_group") + } } } },