diff --git a/yuthon_hr_attendance/models/yuthon_shift_planning.py b/yuthon_hr_attendance/models/yuthon_shift_planning.py index a4ddb2af5..3e51a8c31 100644 --- a/yuthon_hr_attendance/models/yuthon_shift_planning.py +++ b/yuthon_hr_attendance/models/yuthon_shift_planning.py @@ -28,7 +28,7 @@ class YuthonShiftPlanning(models.Model): target_year = year if (not next_date or selected_month != 12) else year + 1 start_date = datetime(target_year, target_month, 1) next_month_first_day = start_date + relativedelta(months=1) - end_date = next_month_first_day - relativedelta(seconds=1) + end_date = next_month_first_day - timedelta(days=1) existing_slots = self.env['planning.slot'].search([ ('role_id.name', '=', '保安部'),