diff --git a/yuthon_hr_attendance/models/go_approval.py b/yuthon_hr_attendance/models/go_approval.py index e11378be0..59ec723c1 100644 --- a/yuthon_hr_attendance/models/go_approval.py +++ b/yuthon_hr_attendance/models/go_approval.py @@ -58,13 +58,12 @@ class GoApprovals(models.Model): if not rec.start_date or not rec.end_date or not rec.employee_ids: continue for employee in rec.employee_ids: - # 查找同一员工其他外出申请中时间段有交叉的记录(排除自身,排除已撤销的) + # 查找同一员工其他外出申请中时间段有交叉的记录(排除自身,active=False即撤销的自动被排除) overlapping = self.env['go.approval'].search([ ('id', '!=', rec.id), ('employee_ids', 'in', employee.id), ('start_date', '<=', rec.end_date), ('end_date', '>=', rec.start_date), - ('reclaim_state', '=', False), ]) if overlapping: raise ValidationError(