mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
fix: make New Leaves Allocated read-only if policy assignment is linked to the allocation and leave type is earned leave
This commit is contained in:
@@ -34,6 +34,15 @@ frappe.ui.form.on("Leave Allocation", {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make new leaves allocated field read only if allocation is created via leave policy assignment
|
||||||
|
// and leave type is earned leave, since these leaves would be allocated via the scheduler
|
||||||
|
if (frm.doc.leave_policy_assignment) {
|
||||||
|
frappe.db.get_value("Leave Type", frm.doc.leave_type, "is_earned_leave", (r) => {
|
||||||
|
if (r && cint(r.is_earned_leave))
|
||||||
|
frm.set_df_property("new_leaves_allocated", "read_only", 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
expire_allocation: function(frm) {
|
expire_allocation: function(frm) {
|
||||||
|
|||||||
Reference in New Issue
Block a user