chore: hardcode doctype

This commit is contained in:
Ankush Menat 2022-11-17 11:58:05 +05:30
parent c460141f0d
commit 1bd886387b
4 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@ def get_children(doctype, parent=None, company=None, is_root=False):
else:
filters["parent_department"] = parent
return frappe.get_all(doctype, fields=fields, filters=filters, order_by="name")
return frappe.get_all("Department", fields=fields, filters=filters, order_by="name")
@frappe.whitelist()