Merge pull request #22723 from Anurag810/HR-fix

This commit is contained in:
Suraj Shetty 2020-08-14 16:43:28 +05:30 committed by GitHub
commit 404afb823f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -5,20 +5,23 @@ cur_frm.add_fetch('employee','employee_name','employee_name');
frappe.ui.form.on("Leave Allocation", {
onload: function(frm) {
// Ignore cancellation of doctype on cancel all.
frm.ignore_doctypes_on_cancel_all = ["Leave Ledger Entry"];
if(!frm.doc.from_date) frm.set_value("from_date", frappe.datetime.get_today());
frm.set_query("employee", function() {
return {
query: "erpnext.controllers.queries.employee_query"
}
};
});
frm.set_query("leave_type", function() {
return {
filters: {
is_lwp: 0
}
}
})
};
});
},
refresh: function(frm) {

View File

@ -19,6 +19,10 @@ frappe.ui.form.on("Leave Application", {
frm.set_query("employee", erpnext.queries.employee);
},
onload: function(frm) {
// Ignore cancellation of doctype on cancel all.
frm.ignore_doctypes_on_cancel_all = ["Leave Ledger Entry"];
if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.get_today());
}

View File

@ -2,6 +2,10 @@
// For license information, please see license.txt
frappe.ui.form.on('Leave Encashment', {
onload: function(frm) {
// Ignore cancellation of doctype on cancel all.
frm.ignore_doctypes_on_cancel_all = ["Leave Ledger Entry"];
},
setup: function(frm) {
frm.set_query("leave_type", function() {
return {
@ -33,7 +37,7 @@ frappe.ui.form.on('Leave Encashment', {
doc: frm.doc,
callback: function(r) {
frm.refresh_fields();
}
}
});
}
}