Undo replace of frappe.db.sql with frappe.get_list (#14074)

This commit is contained in:
Suraj Shetty
2018-05-16 13:53:31 +05:30
committed by Faris Ansari
parent 265005d30d
commit fbb6b3da5f
6 changed files with 72 additions and 75 deletions

View File

@@ -169,10 +169,11 @@ def get_children(doctype, parent, is_root=False):
if is_root:
parent = ''
land_units = frappe.get_list(doctype,
fields = ['name as value', 'is_group as expandable'],
filters= [['parent_land_unit', '=', parent]],
order_by='name')
land_units = frappe.db.sql("""select name as value,
is_group as expandable
from `tabLand Unit`
where ifnull(`parent_land_unit`,'') = %s
order by name""", (parent), as_dict=1)
# return nodes
return land_units