1
This commit is contained in:
@@ -467,7 +467,7 @@ class HrAttendanceDetail(models.Model):
|
||||
min_time = min(checkin_time_list)
|
||||
# 查询最早时间上班时间 查询最晚下班时间
|
||||
# 判断时间 在10分钟内说明是 异常
|
||||
if will_datetime_start + timedelta(minutes=10) > min_time > will_datetime_start:
|
||||
if will_datetime_start + timedelta(minutes=10) > min_time > will_datetime_start + timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_in_time": will_datetime_start,
|
||||
"check_in": min_time,
|
||||
@@ -476,7 +476,7 @@ class HrAttendanceDetail(models.Model):
|
||||
"is_abnormal": True,
|
||||
"absenteeism_card": False,
|
||||
})
|
||||
elif will_datetime_start + timedelta(hours=1) > min_time > will_datetime_start:
|
||||
elif will_datetime_start + timedelta(hours=1) > min_time > will_datetime_start + timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_in_time": will_datetime_start,
|
||||
"check_in": min_time,
|
||||
@@ -485,7 +485,7 @@ class HrAttendanceDetail(models.Model):
|
||||
"is_abnormal": False,
|
||||
"absenteeism_card": False,
|
||||
})
|
||||
elif min_time > will_datetime_start + timedelta(hours=1) and min_time > will_datetime_start:
|
||||
elif min_time > will_datetime_start + timedelta(hours=1) and min_time > will_datetime_start + timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_in_time": will_datetime_start,
|
||||
"check_in": min_time,
|
||||
@@ -553,7 +553,7 @@ class HrAttendanceDetail(models.Model):
|
||||
max_time = max(checkin_time_list)
|
||||
# 如果上班没有打卡
|
||||
if not attendance_obj.check_in:
|
||||
if will_datetime_start + timedelta(minutes=10) > max_time > will_datetime_start:
|
||||
if will_datetime_start + timedelta(minutes=10) > max_time > will_datetime_start + timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_in_time": will_datetime_start,
|
||||
"check_in": max_time,
|
||||
@@ -562,7 +562,7 @@ class HrAttendanceDetail(models.Model):
|
||||
"is_abnormal": True,
|
||||
"absenteeism_card": True,
|
||||
})
|
||||
elif will_datetime_start + timedelta(hours=1) > max_time > will_datetime_start:
|
||||
elif will_datetime_start + timedelta(hours=1) > max_time > will_datetime_start + timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_in_time": will_datetime_start,
|
||||
"check_in": max_time,
|
||||
@@ -571,7 +571,7 @@ class HrAttendanceDetail(models.Model):
|
||||
"is_abnormal": True,
|
||||
"absenteeism_card": True,
|
||||
})
|
||||
elif max_time > will_datetime_start + timedelta(hours=1) and max_time > will_datetime_start:
|
||||
elif max_time > will_datetime_start + timedelta(hours=1) and max_time > will_datetime_start + timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_in_time": will_datetime_start,
|
||||
"check_in": max_time,
|
||||
@@ -594,7 +594,7 @@ class HrAttendanceDetail(models.Model):
|
||||
elif attendance_obj.check_in >= max_time:
|
||||
attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True, "absenteeism_card": True})
|
||||
else:
|
||||
if will_datetime_end - timedelta(minutes=10) < max_time < will_datetime_end:
|
||||
if will_datetime_end - timedelta(minutes=10) < max_time < will_datetime_end - timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_out_time": will_datetime_end,
|
||||
"check_out": max_time,
|
||||
@@ -603,7 +603,7 @@ class HrAttendanceDetail(models.Model):
|
||||
"is_abnormal": True,
|
||||
# "absenteeism_card": False,
|
||||
})
|
||||
elif will_datetime_end - timedelta(hours=1) < max_time < will_datetime_end:
|
||||
elif will_datetime_end - timedelta(hours=1) < max_time < will_datetime_end - timedelta(minutes=1):
|
||||
attendance_obj.sudo().write({
|
||||
"sch_check_out_time": will_datetime_end,
|
||||
"check_out": max_time,
|
||||
|
||||
Reference in New Issue
Block a user