Fix:Child account which is not a group account is treating as Parent Account while creating New Department. #20599
This commit is contained in:
parent
c2c12dc82f
commit
21b1a00f61
@ -2,12 +2,18 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Department', {
|
frappe.ui.form.on('Department', {
|
||||||
|
onload: function(frm) {
|
||||||
|
frm.set_query("parent_department", function(){
|
||||||
|
return { "filters": [["Department", "is_group", "=", 1]]}
|
||||||
|
});
|
||||||
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
// read-only for root department
|
// read-only for root department
|
||||||
if(!frm.doc.parent_department && !frm.is_new()) {
|
if(!frm.doc.parent_department && !frm.is_new()) {
|
||||||
frm.set_read_only();
|
frm.set_read_only();
|
||||||
frm.set_intro(__("This is a root department and cannot be edited."));
|
frm.set_intro(__("This is a root department and cannot be edited."));
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
validate: function(frm) {
|
validate: function(frm) {
|
||||||
if(frm.doc.name=="All Departments") {
|
if(frm.doc.name=="All Departments") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user