From 773ff28d7f93e22ec220ad3f86ddedeffec4ea3f Mon Sep 17 00:00:00 2001 From: zhouzhou <123@qq.com> Date: Tue, 24 Dec 2024 12:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/yuthon_duty_plan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_duty_plan.py b/yuthon_hr_attendance/models/yuthon_duty_plan.py index c0e97382d..fb4f31b04 100644 --- a/yuthon_hr_attendance/models/yuthon_duty_plan.py +++ b/yuthon_hr_attendance/models/yuthon_duty_plan.py @@ -66,13 +66,13 @@ class YuthonDutyPlan(models.Model): if zu == len(self.plan_line_ids): zu = 0 for employee in self.plan_line_ids[zu].employee_ids: - employee_id = self.env['planning.slot'].search([('resource_id', '=', employee.resource_id.id),('start_datetime', '>=', first_day_of_month), ('start_datetime', '<=', last_day_of_month)]).sorted('start_datetime') + employee_id = self.env['planning.slot'].search([('resource_id', '=', employee.resource_id.id), ('start_datetime', '>=', first_day_of_month), ('start_datetime', '<=', last_day_of_month)]).sorted('start_datetime') if i < len(employee_id): start_hour2 = int(role_template_b.start_time) end_hour2 = int(role_template_b.end_time) current_datetime = datetime.combine(current_date2, time(0, 0, 0)) start_time2 = current_datetime.replace(hour=start_hour2, minute=30) - timedelta(hours=8) - end_time2 = current_datetime.replace(hour=end_hour2, minute=30) - timedelta(hours=8) + timedelta(days=1) + end_time2 = current_datetime.replace(hour=end_hour2, minute=30) - timedelta(hours=8) employee_id[i].write({ 'resource_id': employee.resource_id.id, 'template_id': role_template_b.id,