From 5c60764f0501588b834da66262812240df57504a 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: Fri, 24 Jul 2026 11:05:03 +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 --- .../models/yuthon_vacation_reports.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 577db3f0a..8a382f32c 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -2660,7 +2660,7 @@ class YuthonVacationReports(models.Model): today = date.today() last_month_first = (today - relativedelta(months=1)).replace(day=1) # 上月1号 current_month_first = today.replace(day=1) # 本月1号 - current_month_first_dt = datetime.combine(current_month_first, datetime.min.time()) + current_month_first_dt = datetime.combine(current_month_first + relativedelta(months=1) - timedelta(days=1), datetime.min.time()) dec_2025_end = datetime(2025, 12, 31, 23, 59, 59) # 3. 仅处理集团本部的数据 @@ -2681,15 +2681,15 @@ class YuthonVacationReports(models.Model): employee_summary = {} for line in all_records: - line.select_month = str(last_month_first.month) - line.select_year = str(last_month_first.year) + line.select_month = str(current_month_first.month) + line.select_year = str(current_month_first.year) emp_id = line.employee_id.id if not emp_id: continue if emp_id not in employee_summary: report_id = self.env['yuthon.vacation.reports'].search( [ - ('vacation_date', '=', last_month_first), + ('vacation_date', '=', current_month_first), ('employee_id', '=', emp_id), ], limit=1 # 避免多条记录,只取第一条 @@ -2697,8 +2697,8 @@ class YuthonVacationReports(models.Model): vacation_sum = report_id.dynamic_previous_year1 * 8 + report_id.this_year1 * 8 if report_id else 0.0 active_id = self.env['vacation.overtime.active'].search( [('employee_id', '=', emp_id), - ('select_month', '=', str(last_month_first.month)), - ('select_year', '=', str(last_month_first.year)), + ('select_month', '=', str(current_month_first.month)), + ('select_year', '=', str(current_month_first.year)), ('select_revoke', '!=', 'done'), ]) if active_id: