diff --git a/yuthon_wechat/models/hr_attendance_detail.py b/yuthon_wechat/models/hr_attendance_detail.py index 32f4992a7..b686abddf 100644 --- a/yuthon_wechat/models/hr_attendance_detail.py +++ b/yuthon_wechat/models/hr_attendance_detail.py @@ -254,7 +254,7 @@ class HrAttendanceDetail(models.Model): min_hour_from = attendance_obj.employee_id.resource_id.calendar_id.attendance_ids[0].hour_from min_hour = int(min_hour_from) min_minute = int(min_hour_from * 10 % min_hour_from) - max_hour_to = checkin_time.employee_id.resource_id.calendar_id.attendance_ids[-1].hour_to + max_hour_to = attendance_obj.employee_id.resource_id.calendar_id.attendance_ids[-1].hour_to max_hour = int(max_hour_to) max_minute = int(max_hour_to * 10 % max_hour_to) if attendance_obj.is_approval: