mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 02:31:21 +00:00
feat: skip disabled accounts in COA (#38551)
* feat: skip disabled accounts in coa * fix: add parameter to other tree doctype utils
This commit is contained in:
committed by
GitHub
parent
cd37fd790b
commit
b7f283b2f0
@@ -69,7 +69,9 @@ def get_abbreviated_name(name, company):
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_children(doctype, parent=None, company=None, is_root=False):
|
||||
def get_children(doctype, parent=None, company=None, is_root=False, include_disabled=False):
|
||||
if isinstance(include_disabled, str):
|
||||
include_disabled = frappe.json.loads(include_disabled)
|
||||
fields = ["name as value", "is_group as expandable"]
|
||||
filters = {}
|
||||
|
||||
@@ -81,6 +83,9 @@ def get_children(doctype, parent=None, company=None, is_root=False):
|
||||
else:
|
||||
filters["parent_department"] = parent
|
||||
|
||||
if frappe.db.has_column(doctype, "disabled") and not include_disabled:
|
||||
filters["disabled"] = False
|
||||
|
||||
return frappe.get_all("Department", fields=fields, filters=filters, order_by="name")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user