From a68690ff58ba06ccce2c9ae4dc2820e11d82da94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Tue, 11 Nov 2025 18:16:14 +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_vacation_reports.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 44206c4d6..6aea4c950 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -657,7 +657,8 @@ class YuthonVacationReports(models.Model): def automatic_confirmation(self): current_date = fields.Date.today() vacation_ids = self.env["yuthon.vacation.reports"].search([ - ('vacation_date', '=', current_date.replace(day=1)) + ('vacation_date', '=', current_date.replace(day=1)), + ('vacation_state', '=', 'unconfirmed') ]) for rec in vacation_ids: month_start = current_date.replace(day=1) @@ -682,11 +683,9 @@ class YuthonVacationReports(models.Model): for employee in employees: resource_user_ids = employee.resource_calendar_id.resource_user_ids.ids is_resource_user = employee.id in resource_user_ids - existing_record = self.search([ ('employee_id', '=', employee.id), - ('vacation_date', '=', today), - ('vacation_state', '=', 'unconfirmed') + ('vacation_date', '=', today) ], limit=1) if not existing_record or not is_resource_user: