fix: fetch item on the base of item group

This commit is contained in:
Anurag Mishra 2019-06-12 19:09:51 +05:30
parent 4ca393d14c
commit bbe2c4fb01
2 changed files with 7 additions and 1 deletions

View File

@ -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): def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False):
conditions = [] conditions = []
if not filters["item_group"]:
filters.pop("item_group", None)
description_cond = '' description_cond = ''
if frappe.db.count('Item', cache=True) < 50000: if frappe.db.count('Item', cache=True) < 50000:
# scan description only if items are less than 50000 # scan description only if items are less than 50000

View File

@ -40,7 +40,10 @@ frappe.query_reports["Stock Balance"] = {
"options": "Item", "options": "Item",
"get_query": function() { "get_query": function() {
return { return {
query: "erpnext.controllers.queries.item_query" query: "erpnext.controllers.queries.item_query",
filters: {
"item_group": frappe.query_report.get_filter_value("item_group")
}
} }
} }
}, },