From 418c1e0ad775ec7fb7f71fb489e036869a730586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 13 May 2026 10:30:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=80=83=E5=8B=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_holiday/models/inherit_hr_leave_allocation.py | 10 ++++++---- .../views/inherit_hr_leave_allocation_views.xml | 11 ----------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/yuthon_holiday/models/inherit_hr_leave_allocation.py b/yuthon_holiday/models/inherit_hr_leave_allocation.py index 484c032c2..79bad322a 100644 --- a/yuthon_holiday/models/inherit_hr_leave_allocation.py +++ b/yuthon_holiday/models/inherit_hr_leave_allocation.py @@ -214,10 +214,10 @@ class HrLeaveAllocation(models.Model): return super(HrLeaveAllocation, self).unlink() - def update_vacation(self): - leave_ids = self.env["hr.leave.allocation"].browse( - self._context.get('active_ids', self._context.get('active_id'))) - for leave in leave_ids: + def action_validate(self): + result = super(HrLeaveAllocation, self).action_validate() + + for leave in self: if leave.holiday_status_id.name != '年假': continue @@ -242,6 +242,8 @@ class HrLeaveAllocation(models.Model): })] }) reports_id.update_line() + + return result def update_employee(self): leave_ids = self.env["hr.leave.allocation"].browse( diff --git a/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml b/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml index a32fdff1e..bd79478f0 100644 --- a/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml +++ b/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml @@ -28,10 +28,6 @@ 0 - -