Skip to content

Commit 840bfa8

Browse files
Mangesh-Khairnarnabinhait
authored andcommitted
fix: change the department to tree view (frappe#18056)
1 parent b2c43ee commit 840bfa8

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

erpnext/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
on_session_creation = "erpnext.shopping_cart.utils.set_cart_count"
4343
on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
4444

45-
treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', 'Assessment Group']
45+
treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', 'Assessment Group', 'Department']
4646

4747
# website
4848
update_website_context = "erpnext.shopping_cart.utils.update_website_context"

erpnext/hr/doctype/department/department.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
frappe.ui.form.on('Department', {
55
refresh: function(frm) {
66
// read-only for root department
7-
if(!frm.doc.parent_department) {
7+
if(!frm.doc.parent_department && !frm.is_new()) {
88
frm.set_read_only();
99
frm.set_intro(__("This is a root department and cannot be edited."));
1010
}

erpnext/hr/doctype/department/department.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"allow_copy": 0,
3+
"allow_events_in_timeline": 0,
34
"allow_guest_to_view": 0,
45
"allow_import": 1,
56
"allow_rename": 1,
@@ -19,6 +20,7 @@
1920
"bold": 0,
2021
"collapsible": 0,
2122
"columns": 0,
23+
"fetch_if_empty": 0,
2224
"fieldname": "department_name",
2325
"fieldtype": "Data",
2426
"hidden": 0,
@@ -52,6 +54,7 @@
5254
"bold": 0,
5355
"collapsible": 0,
5456
"columns": 0,
57+
"fetch_if_empty": 0,
5558
"fieldname": "parent_department",
5659
"fieldtype": "Link",
5760
"hidden": 0,
@@ -85,6 +88,7 @@
8588
"bold": 0,
8689
"collapsible": 0,
8790
"columns": 0,
91+
"fetch_if_empty": 0,
8892
"fieldname": "company",
8993
"fieldtype": "Link",
9094
"hidden": 0,
@@ -118,6 +122,7 @@
118122
"bold": 1,
119123
"collapsible": 0,
120124
"columns": 0,
125+
"fetch_if_empty": 0,
121126
"fieldname": "is_group",
122127
"fieldtype": "Check",
123128
"hidden": 0,
@@ -150,6 +155,7 @@
150155
"bold": 0,
151156
"collapsible": 0,
152157
"columns": 0,
158+
"fetch_if_empty": 0,
153159
"fieldname": "disabled",
154160
"fieldtype": "Check",
155161
"hidden": 0,
@@ -182,6 +188,7 @@
182188
"bold": 0,
183189
"collapsible": 0,
184190
"columns": 0,
191+
"fetch_if_empty": 0,
185192
"fieldname": "section_break_4",
186193
"fieldtype": "Section Break",
187194
"hidden": 0,
@@ -214,6 +221,7 @@
214221
"collapsible": 0,
215222
"columns": 0,
216223
"description": "Days for which Holidays are blocked for this department.",
224+
"fetch_if_empty": 0,
217225
"fieldname": "leave_block_list",
218226
"fieldtype": "Link",
219227
"hidden": 0,
@@ -246,6 +254,7 @@
246254
"bold": 0,
247255
"collapsible": 0,
248256
"columns": 0,
257+
"fetch_if_empty": 0,
249258
"fieldname": "leave_section",
250259
"fieldtype": "Section Break",
251260
"hidden": 0,
@@ -279,6 +288,7 @@
279288
"collapsible": 0,
280289
"columns": 0,
281290
"description": "The first Leave Approver in the list will be set as the default Leave Approver.",
291+
"fetch_if_empty": 0,
282292
"fieldname": "leave_approvers",
283293
"fieldtype": "Table",
284294
"hidden": 0,
@@ -312,6 +322,7 @@
312322
"bold": 0,
313323
"collapsible": 0,
314324
"columns": 0,
325+
"fetch_if_empty": 0,
315326
"fieldname": "expense_section",
316327
"fieldtype": "Section Break",
317328
"hidden": 0,
@@ -345,6 +356,7 @@
345356
"collapsible": 0,
346357
"columns": 0,
347358
"description": "The first Expense Approver in the list will be set as the default Expense Approver.",
359+
"fetch_if_empty": 0,
348360
"fieldname": "expense_approvers",
349361
"fieldtype": "Table",
350362
"hidden": 0,
@@ -378,6 +390,7 @@
378390
"bold": 0,
379391
"collapsible": 0,
380392
"columns": 0,
393+
"fetch_if_empty": 0,
381394
"fieldname": "lft",
382395
"fieldtype": "Int",
383396
"hidden": 1,
@@ -410,6 +423,7 @@
410423
"bold": 0,
411424
"collapsible": 0,
412425
"columns": 0,
426+
"fetch_if_empty": 0,
413427
"fieldname": "rgt",
414428
"fieldtype": "Int",
415429
"hidden": 1,
@@ -442,6 +456,7 @@
442456
"bold": 0,
443457
"collapsible": 0,
444458
"columns": 0,
459+
"fetch_if_empty": 0,
445460
"fieldname": "old_parent",
446461
"fieldtype": "Data",
447462
"hidden": 1,
@@ -479,7 +494,7 @@
479494
"issingle": 0,
480495
"istable": 0,
481496
"max_attachments": 0,
482-
"modified": "2018-08-29 06:26:12.995703",
497+
"modified": "2019-06-25 18:43:05.550387",
483498
"modified_by": "Administrator",
484499
"module": "HR",
485500
"name": "Department",
@@ -543,7 +558,7 @@
543558
"write": 1
544559
}
545560
],
546-
"quick_entry": 1,
561+
"quick_entry": 0,
547562
"read_only": 0,
548563
"read_only_onload": 0,
549564
"show_name_in_global_search": 1,

0 commit comments

Comments
 (0)