diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index e8ff74ff1..358a317b6 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1032,10 +1032,7 @@ class YuthonVacationReports(models.Model): base_month = int(base_line.select_month) base_date = date(base_year, base_month, 1) self.env['yuthon.overtime.line'].search([]).unlink() - # 上上个月第一天(用于select_month赋值) - last_month_first = (base_date - relativedelta(months=2)).replace(day=1) - # 上上个月最后一天(时间筛选的截止点) - current_month_last = (base_date - relativedelta(months=1)).replace(day=1) - timedelta(days=1) + current_month_last = base_date - timedelta(days=1) current_month_last_dt = datetime.combine(current_month_last, datetime.min.time()) dec_2025_end = datetime(2025, 12, 31, 23, 59, 59) if self.env.user.company_id.name == '集团本部': @@ -1077,8 +1074,8 @@ class YuthonVacationReports(models.Model): 'carry_forward_quantity': 0.0, 'carry_forward_date': line.carry_forward_date, 'remaining_quantity': 0.0, - 'select_month': str(last_month_first.month), - 'select_year': str(last_month_first.year) + 'select_month': str(current_month_last.month), + 'select_year': str(current_month_last.year) } summary = employee_summary[emp_id] @@ -1103,7 +1100,6 @@ class YuthonVacationReports(models.Model): base_month = int(base_line.select_month) base_date = date(base_year, base_month, 1) self.env['yuthon.overtime.line'].search([]).unlink() - next_month_first = (base_date + relativedelta(months=1)).replace(day=1) next_month_last = (base_date + relativedelta(months=2)).replace(day=1) - timedelta(days=1) next_month_last_dt = datetime.combine(next_month_last, datetime.min.time()) dec_2025_end = datetime(2025, 12, 31, 23, 59, 59) @@ -1144,8 +1140,8 @@ class YuthonVacationReports(models.Model): 'public_holidays': 0.0, 'carry_forward_quantity': 0.0, 'carry_forward_date': line.carry_forward_date, - 'select_month': str(next_month_first.month), - 'select_year': str(next_month_first.year) + 'select_month': str(next_month_last.month), + 'select_year': str(next_month_last.year) } summary = employee_summary[emp_id]