chore: hardcode doctype

This commit is contained in:
Ankush Menat
2022-11-17 11:58:05 +05:30
parent 85d8540379
commit 9d5c4ffadf
4 changed files with 7 additions and 7 deletions

View File

@@ -200,11 +200,11 @@ def get_children(doctype, parent=None, location=None, is_root=False):
name as value, name as value,
is_group as expandable is_group as expandable
from from
`tab{doctype}` comp `tabLocation` comp
where where
ifnull(parent_location, "")={parent} ifnull(parent_location, "")={parent}
""".format( """.format(
doctype=doctype, parent=frappe.db.escape(parent) parent=frappe.db.escape(parent)
), ),
as_dict=1, as_dict=1,
) )

View File

@@ -70,11 +70,11 @@ def get_children(doctype, parent=None, company=None, is_root=False):
select select
name as value, name as value,
is_group as expandable is_group as expandable
from `tab{doctype}` from `tabDepartment`
where where
{condition} {condition}
order by name""".format( order by name""".format(
doctype=doctype, condition=condition condition=condition
), ),
var_dict, var_dict,
as_dict=1, as_dict=1,

View File

@@ -79,7 +79,7 @@ def get_children(doctype, parent=None, parent_quality_procedure=None, is_root=Fa
] ]
else: else:
return frappe.get_all( return frappe.get_all(
doctype, "Quality Procedure",
fields=["name as value", "is_group as expandable"], fields=["name as value", "is_group as expandable"],
filters=dict(parent_quality_procedure=parent), filters=dict(parent_quality_procedure=parent),
order_by="name asc", order_by="name asc",

View File

@@ -611,11 +611,11 @@ def get_children(doctype, parent=None, company=None, is_root=False):
name as value, name as value,
is_group as expandable is_group as expandable
from from
`tab{doctype}` comp `tabCompany` comp
where where
ifnull(parent_company, "")={parent} ifnull(parent_company, "")={parent}
""".format( """.format(
doctype=doctype, parent=frappe.db.escape(parent) parent=frappe.db.escape(parent)
), ),
as_dict=1, as_dict=1,
) )