From 5e0677f9776b0360bb82befbf47c13775c50f9c9 Mon Sep 17 00:00:00 2001 From: Aysha <74527579+AyshaHakeem@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:43:26 +0530 Subject: [PATCH] fix: submit attendance request for future dates (#2352) (cherry picked from commit 97559c30abe410c71a65ede9c010ce6512836e58) --- hrms/hr/doctype/attendance/attendance.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/hrms/hr/doctype/attendance/attendance.py b/hrms/hr/doctype/attendance/attendance.py index 192c820d4f..cd94b2476a 100644 --- a/hrms/hr/doctype/attendance/attendance.py +++ b/hrms/hr/doctype/attendance/attendance.py @@ -50,18 +50,7 @@ def on_cancel(self): def validate_attendance_date(self): date_of_joining = frappe.db.get_value("Employee", self.employee, "date_of_joining") - # leaves can be marked for future dates - if ( - self.status != "On Leave" - and not self.leave_application - and getdate(self.attendance_date) > getdate(nowdate()) - ): - frappe.throw( - _("Attendance can not be marked for future dates: {0}").format( - frappe.bold(format_date(self.attendance_date)), - ) - ) - elif date_of_joining and getdate(self.attendance_date) < getdate(date_of_joining): + if date_of_joining and getdate(self.attendance_date) < getdate(date_of_joining): frappe.throw( _("Attendance date {0} can not be less than employee {1}'s joining date: {2}").format( frappe.bold(format_date(self.attendance_date)),