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
-
-
-
@@ -75,13 +71,6 @@
code
action = model.action_uninstall_wizard()
-
- 同步考勤数据
-
-
- code
- action = model.update_vacation()
-
更新结束时间