[FIX] hr_holidays: leave holiday overlap should ignore cancelled/refused ones
Obviously a cancelled leave does not really overlap with a new one. bzr revid: odo@openerp.com-20131023162928-56vdsjxr8sa4n3jv Closes #2329
This commit is contained in:
parent
2c37f83435
commit
dc0e126b53
|
@ -141,7 +141,9 @@ class hr_holidays(osv.osv):
|
|||
|
||||
def _check_date(self, cr, uid, ids):
|
||||
for holiday in self.browse(cr, uid, ids):
|
||||
holiday_ids = self.search(cr, uid, [('date_from', '<=', holiday.date_to), ('date_to', '>=', holiday.date_from), ('employee_id', '=', holiday.employee_id.id), ('id', '<>', holiday.id)])
|
||||
holiday_ids = self.search(cr, uid, [('date_from', '<=', holiday.date_to), ('date_to', '>=', holiday.date_from),
|
||||
('employee_id', '=', holiday.employee_id.id), ('id', '<>', holiday.id),
|
||||
('state', 'not in', ['cancel', 'refuse'])])
|
||||
if holiday_ids:
|
||||
return False
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue