Merge pull request #20604 from AnilPise/develop

fix: Parent Department filter while creating a new department
This commit is contained in:
Deepesh Garg 2020-02-18 17:44:51 +05:30 committed by GitHub
commit 33ad0dafcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,11 @@
// For license information, please see license.txt
frappe.ui.form.on('Department', {
onload: function(frm) {
frm.set_query("parent_department", function(){
return {"filters": [["Department", "is_group", "=", 1]]};
});
},
refresh: function(frm) {
// read-only for root department
if(!frm.doc.parent_department && !frm.is_new()) {