fix: query for against types

This commit is contained in:
Gursheen Anand 2023-12-03 22:36:54 +05:30 committed by Deepesh Garg
parent 0b1cc7fad1
commit 39c8507dc2

View File

@ -1625,3 +1625,10 @@ def make_reverse_journal_entry(source_name, target_doc=None):
)
return doclist
@frappe.whitelist()
def get_against_type(doctype, txt, searchfield, start, page_len, filters):
against_types = frappe.db.get_list("Party Type", pluck="name") + ["Account"]
doctype = frappe.qb.DocType("DocType")
return frappe.qb.from_(doctype).select(doctype.name).where(doctype.name.isin(against_types)).run()