From 357775e37118aebd7780f6496c76094e0b33f7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 4 Mar 2026 18:39:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/yuthon_vacation_reports.py | 38 ------------------- .../views/yuthon_vacation_reports_views.xml | 6 +-- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 23b81938c..9f6c7bd5d 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -700,44 +700,6 @@ class YuthonVacationReports(models.Model): f"已存在假期额度记录,不能重复创建!" ) - def action_prev_month(self): - """跳转到上一个月的假期记录""" - self.ensure_one() - prev_date = (self.vacation_date - relativedelta(months=1)).replace(day=1) - prev_record = self.search([ - ('employee_id', '=', self.employee_id.id), - ('vacation_date', '=', prev_date), - ], limit=1) - if not prev_record: - raise UserError('上一个月没有对应的假期记录') - action = self.env['ir.actions.actions']._for_xml_id('yuthon_hr_attendance.view_yuthon_vacation_reports_action') - action.update({ - 'res_id': prev_record.id, - 'views': [(False, 'form')], - 'view_mode': 'form', - 'target': 'current', - }) - return action - - def action_next_month(self): - """跳转到下一个月的假期记录""" - self.ensure_one() - next_date = (self.vacation_date + relativedelta(months=1)).replace(day=1) - next_record = self.search([ - ('employee_id', '=', self.employee_id.id), - ('vacation_date', '=', next_date), - ], limit=1) - if not next_record: - raise UserError('下一个月没有对应的假期记录') - action = self.env['ir.actions.actions']._for_xml_id('yuthon_hr_attendance.view_yuthon_vacation_reports_action') - action.update({ - 'res_id': next_record.id, - 'views': [(False, 'form')], - 'view_mode': 'form', - 'target': 'current', - }) - return action - def action_open(self): self.ensure_one() target_date = self.vacation_date.replace(day=1) diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index 231128d5f..d43a29a1c 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -180,12 +180,10 @@ -
-