mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 00:01:18 +00:00
fix: Org Chart fixes (#27290)
* fix(org chart): multiple root nodes not expanding on clicking Expand All
* fix: unstable filter inserts duplicate nodes
(cherry picked from commit f828d853e3)
# Conflicts:
# erpnext/public/js/hierarchy_chart/hierarchy_chart_desktop.js
# erpnext/utilities/hierarchy_chart.py
This commit is contained in:
@@ -223,7 +223,11 @@ erpnext.HierarchyChart = class {
|
||||
let node = undefined;
|
||||
|
||||
$.each(r.message, (_i, data) => {
|
||||
<<<<<<< HEAD
|
||||
if ($(`[id="${data.id}"]`).length)
|
||||
=======
|
||||
if ($(`#${data.id}`).length)
|
||||
>>>>>>> f828d853e3 (fix: Org Chart fixes (#27290))
|
||||
return;
|
||||
|
||||
node = new me.Node({
|
||||
@@ -351,13 +355,21 @@ erpnext.HierarchyChart = class {
|
||||
}
|
||||
|
||||
get_all_nodes() {
|
||||
<<<<<<< HEAD
|
||||
let me = this;
|
||||
=======
|
||||
>>>>>>> f828d853e3 (fix: Org Chart fixes (#27290))
|
||||
return new Promise(resolve => {
|
||||
frappe.call({
|
||||
method: 'erpnext.utilities.hierarchy_chart.get_all_nodes',
|
||||
args: {
|
||||
<<<<<<< HEAD
|
||||
method: me.method,
|
||||
company: me.company
|
||||
=======
|
||||
method: this.method,
|
||||
company: this.company
|
||||
>>>>>>> f828d853e3 (fix: Org Chart fixes (#27290))
|
||||
},
|
||||
callback: (r) => {
|
||||
resolve(r.message);
|
||||
|
||||
@@ -8,7 +8,11 @@ from frappe import _
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_all_nodes(method, company):
|
||||
<<<<<<< HEAD
|
||||
"""Recursively gets all data from nodes"""
|
||||
=======
|
||||
'''Recursively gets all data from nodes'''
|
||||
>>>>>>> f828d853e3 (fix: Org Chart fixes (#27290))
|
||||
method = frappe.get_attr(method)
|
||||
|
||||
if method not in frappe.whitelisted:
|
||||
@@ -21,9 +25,13 @@ def get_all_nodes(method, company):
|
||||
for root in root_nodes:
|
||||
data = method(root.id, company)
|
||||
result.append(dict(parent=root.id, parent_name=root.name, data=data))
|
||||
<<<<<<< HEAD
|
||||
nodes_to_expand.extend(
|
||||
[{"id": d.get("id"), "name": d.get("name")} for d in data if d.get("expandable")]
|
||||
)
|
||||
=======
|
||||
nodes_to_expand.extend([{'id': d.get('id'), 'name': d.get('name')} for d in data if d.get('expandable')])
|
||||
>>>>>>> f828d853e3 (fix: Org Chart fixes (#27290))
|
||||
|
||||
while nodes_to_expand:
|
||||
parent = nodes_to_expand.pop(0)
|
||||
|
||||
Reference in New Issue
Block a user