diff --git a/yuthon_wechat/models/hr_attendance_detail.py b/yuthon_wechat/models/hr_attendance_detail.py index 2fdf2a219..1131f49cd 100644 --- a/yuthon_wechat/models/hr_attendance_detail.py +++ b/yuthon_wechat/models/hr_attendance_detail.py @@ -625,7 +625,7 @@ class HrAttendanceDetail(models.Model): 'employee_id': hr_employee_obj.id, "userid": user.oauth_uid, "current_data": current_date, - "shift_id": planning_slot_id[0].id, + "shift_id": planning_slot_id.id, "attendance_type": "wx_work" }) else: @@ -667,7 +667,7 @@ class HrAttendanceDetail(models.Model): min_hour_from = self.env['resource.calendar'].search([])[0].attendance_ids[0].hour_from min_hour = int(min_hour_from) min_minute = int(min_hour_from * 10 % min_hour_from) - max_hour_to = self.env['resource.calendar'].search([])[-1].attendance_ids[0].hour_to + max_hour_to = self.env['resource.calendar'].search([])[0].attendance_ids[-1].hour_to max_hour = int(max_hour_to) max_minute = int(max_hour_to * 10 % max_hour_to) # 判断打卡情况排除未打卡情况