mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
fix: warehouse tree view taking lot of time to load
This commit is contained in:
@@ -140,7 +140,7 @@ class Warehouse(NestedSet):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_children(doctype, parent=None, company=None, is_root=False):
|
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:
|
if is_root:
|
||||||
parent = ""
|
parent = ""
|
||||||
@@ -156,7 +156,7 @@ def get_children(doctype, parent=None, company=None, is_root=False):
|
|||||||
|
|
||||||
# return warehouses
|
# return warehouses
|
||||||
for wh in 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:
|
if company:
|
||||||
wh["company_currency"] = frappe.db.get_value('Company', company, 'default_currency')
|
wh["company_currency"] = frappe.db.get_value('Company', company, 'default_currency')
|
||||||
return warehouses
|
return warehouses
|
||||||
|
|||||||
Reference in New Issue
Block a user