From aed6de9faf8ec3fabb2b59059629988818b3f2ef Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 14 Aug 2025 14:54:52 +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_shift_planning.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_shift_planning.py b/yuthon_hr_attendance/models/yuthon_shift_planning.py index 2ea7ce7f2..85d9aa3a9 100644 --- a/yuthon_hr_attendance/models/yuthon_shift_planning.py +++ b/yuthon_hr_attendance/models/yuthon_shift_planning.py @@ -154,14 +154,12 @@ class YuthonShiftPlanning(models.Model): end_datetime = datetime.combine(current_date, datetime.min.time()).replace( hour=end_hour, minute=end_minute, second=0, microsecond=0 ) - if role_template.day2 == '次日': - end_datetime = end_datetime + timedelta(days=1) self.env['planning.slot'].create({ 'resource_id': record.employee_id.resource_id.id, 'template_id':role_template.id, 'role_id':role.id, - 'start_datetime': start_datetime, - 'end_datetime': end_datetime, + 'start_datetime': start_datetime - timedelta(hours=8), + 'end_datetime': end_datetime - timedelta(hours=8), 'allocated_hours':8, })