fix: exclude active node while fetching sibling group
This commit is contained in:
parent
05ffc0d3e0
commit
09c24c7949
@ -2,8 +2,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_children(parent=None, company=None):
|
||||
|
||||
def get_children(parent=None, company=None, exclude_node=None):
|
||||
filters = [['status', '!=', 'Left']]
|
||||
if company and company != 'All Companies':
|
||||
filters.append(['company', '=', company])
|
||||
@ -13,6 +12,9 @@ def get_children(parent=None, company=None):
|
||||
else:
|
||||
filters.append(['reports_to', '=', ''])
|
||||
|
||||
if exclude_node:
|
||||
filters.append(['name', '!=', exclude_node])
|
||||
|
||||
employees = frappe.get_list('Employee',
|
||||
fields=['employee_name as name', 'name as id', 'reports_to', 'image', 'designation as title'],
|
||||
filters=filters,
|
||||
|
Loading…
x
Reference in New Issue
Block a user