From 0378b1541283952df1f83bf377cdd74c7e4d01c3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 23 May 2019 16:34:32 +0530 Subject: [PATCH] fix: warehouse tree view taking lot of time to load --- erpnext/stock/doctype/warehouse/warehouse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index cfa552cb539..bcb213b123b 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -140,7 +140,7 @@ class Warehouse(NestedSet): @frappe.whitelist() def get_children(doctype, parent=None, company=None, is_root=False): - from erpnext.stock.utils import get_stock_value_on + from erpnext.stock.utils import get_stock_value_from_bin if is_root: parent = "" @@ -156,7 +156,7 @@ def get_children(doctype, parent=None, company=None, is_root=False): # return warehouses for wh in warehouses: - wh["balance"] = get_stock_value_on(warehouse=wh.value, posting_date=nowdate()) + wh["balance"] = get_stock_value_from_bin(warehouse=wh.value) if company: wh["company_currency"] = frappe.db.get_value('Company', company, 'default_currency') return warehouses