fix: set half day date None if half day is unchecked
This commit is contained in:
parent
73edba0e10
commit
8f2cb0beb6
@ -40,6 +40,8 @@ frappe.ui.form.on("Leave Application", {
|
||||
validate: function(frm) {
|
||||
if (frm.doc.from_date == frm.doc.to_date && frm.doc.half_day == 1){
|
||||
frm.doc.half_day_date = frm.doc.from_date;
|
||||
}else if (frm.doc.half_day == 0){
|
||||
frm.doc.half_day_date = undefined;
|
||||
}
|
||||
frm.toggle_reqd("half_day_date", frm.doc.half_day == 1);
|
||||
},
|
||||
|
@ -293,6 +293,8 @@ class LeaveApplication(Document):
|
||||
def set_half_day_date(self):
|
||||
if self.from_date == self.to_date and self.half_day == 1:
|
||||
self.half_day_date = self.from_date
|
||||
elif self.half_day == 0:
|
||||
self.half_day_date = None
|
||||
|
||||
def notify_employee(self):
|
||||
employee = frappe.get_doc("Employee", self.employee)
|
||||
|
Loading…
x
Reference in New Issue
Block a user