Browse Source

fix: exclude active node while fetching sibling group

develop
Rucha Mahabal 3 years ago
parent
commit
c79316a9c0
  1. 6
      erpnext/hr/page/organizational_chart/organizational_chart.py

6
erpnext/hr/page/organizational_chart/organizational_chart.py

@ -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…
Cancel
Save