fix: Not able to cancel application,allocation nad encashments
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.js b/erpnext/hr/doctype/leave_allocation/leave_allocation.js
index 210a73c..a184cc7 100755
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation.js
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.js
@@ -5,20 +5,23 @@
frappe.ui.form.on("Leave Allocation", {
onload: function(frm) {
+ // Ignore cancellation of doctype on cancel all.
+ frm.ignored_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) {
diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js
index 4001a45..a0cce0a 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.js
+++ b/erpnext/hr/doctype/leave_application/leave_application.js
@@ -19,6 +19,10 @@
frm.set_query("employee", erpnext.queries.employee);
},
onload: function(frm) {
+
+ // Ignore cancellation of doctype on cancel all.
+ frm.ignored_doctypes_on_cancel_all = ["Leave Ledger Entry"];
+
if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.get_today());
}
diff --git a/erpnext/hr/doctype/leave_encashment/leave_encashment.js b/erpnext/hr/doctype/leave_encashment/leave_encashment.js
index 701c2f0..d5e7ada 100644
--- a/erpnext/hr/doctype/leave_encashment/leave_encashment.js
+++ b/erpnext/hr/doctype/leave_encashment/leave_encashment.js
@@ -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.ignored_doctypes_on_cancel_all = ["Leave Ledger Entry"];
+ },
setup: function(frm) {
frm.set_query("leave_type", function() {
return {
@@ -33,7 +37,7 @@
doc: frm.doc,
callback: function(r) {
frm.refresh_fields();
- }
+ }
});
}
}