From 4716278f69982fabd218a355cf027b6d6533984d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 29 Apr 2015 19:12:46 +0530 Subject: [PATCH] minor fix in chart of cost centers --- erpnext/accounts/page/accounts_browser/accounts_browser.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.py b/erpnext/accounts/page/accounts_browser/accounts_browser.py index 45540f81ab..bb64e54bac 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.py +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.py @@ -21,12 +21,14 @@ def get_children(): # root if args['parent'] in ("Accounts", "Cost Centers"): + select_cond = ", root_type, report_type" if args["parent"]=="Accounts" else "" + acc = frappe.db.sql(""" select - name as value, is_group as expandable, root_type, report_type + name as value, is_group as expandable %s from `tab%s` where ifnull(parent_%s,'') = '' and `company` = %s and docstatus<2 - order by name""" % (ctype, ctype.lower().replace(' ','_'), '%s'), + order by name""" % (select_cond, ctype, ctype.lower().replace(' ','_'), '%s'), company, as_dict=1) if args["parent"]=="Accounts":