fix: do not sort by number of connections
This commit is contained in:
parent
a48b23e6a5
commit
b6715189fb
@ -24,7 +24,6 @@ def get_children(parent=None, company=None):
|
||||
employee.connections = get_connections(employee.id)
|
||||
employee.expandable = 1 if is_expandable else 0
|
||||
|
||||
employees.sort(key=lambda x: x['connections'], reverse=True)
|
||||
return employees
|
||||
|
||||
|
||||
|
@ -135,8 +135,8 @@ erpnext.HierarchyChart = class {
|
||||
}
|
||||
}).then(r => {
|
||||
if (r.message.length) {
|
||||
let expand_node = undefined;
|
||||
let node = undefined;
|
||||
let first_root = undefined;
|
||||
|
||||
$.each(r.message, (i, data) => {
|
||||
node = new me.Node({
|
||||
@ -151,11 +151,11 @@ erpnext.HierarchyChart = class {
|
||||
is_root: true
|
||||
});
|
||||
|
||||
if (i == 0)
|
||||
first_root = node;
|
||||
if (!expand_node && data.connections)
|
||||
expand_node = node;
|
||||
});
|
||||
|
||||
me.expand_node(first_root);
|
||||
me.expand_node(expand_node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user