File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
hrms/hr/doctype/attendance_request Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,15 @@ def create_or_update_attendance(self, date: str):
100100
101101 if old_status != status :
102102 doc .db_set ({"status" : status , "attendance_request" : self .name })
103- text = _ ("changed the status from {0} to {1} via Attendance Request" ).format (
104- frappe .bold (old_status ), frappe .bold (status )
105- )
103+ if status == "Half Day" :
104+ doc .db_set ("half_day_status" , "Absent" )
105+ text = _ (
106+ "Changed the status from {0} to {1} and Status for Other Half to {2} via Attendance Request"
107+ ).format (frappe .bold (old_status ), frappe .bold (status ), frappe .bold ("Absent" ))
108+ else :
109+ text = _ ("Changed the status from {0} to {1} via Attendance Request" ).format (
110+ frappe .bold (old_status ), frappe .bold (status )
111+ )
106112 doc .add_comment (comment_type = "Info" , text = text )
107113
108114 frappe .msgprint (
@@ -123,6 +129,7 @@ def create_or_update_attendance(self, date: str):
123129 doc .company = self .company
124130 doc .attendance_request = self .name
125131 doc .status = status
132+ doc .half_day_status = "Absent" if status == "Half Day" else None
126133 doc .insert (ignore_permissions = True )
127134 doc .submit ()
128135
You can’t perform that action at this time.
0 commit comments