[FIX] hr_holidays: fix domain in determination of employee leave status

bzr revid: rco@openerp.com-20111223090210-v9rmu26fa3mfklp6
This commit is contained in:
Raphael Collet 2011-12-23 10:02:10 +01:00
parent ae0eddfcbb
commit cbdf42d104
1 changed files with 2 additions and 2 deletions

View File

@ -399,13 +399,13 @@ class hr_employee(osv.osv):
def _get_leave_status(self, cr, uid, ids, name, args, context=None):
holidays_id = self.pool.get('hr.holidays').search(cr, uid,
[('employee_id', 'in', ids), ('date_from','<=',time.strftime('%Y-%m-%d %H:%M:%S')),
('date_to','>=',time.strftime('%Y-%m-%d %H:%M:%S')),('type','=','remove')],
('date_to','>=',time.strftime('%Y-%m-%d %H:%M:%S')),('type','=','remove'),('state','not in',('cancel','refuse'))],
context=context)
result = {}
for id in ids:
result[id] = {
'current_leave_state': False,
'current_leave_id': False
'current_leave_id': False,
}
for holiday in self.pool.get('hr.holidays').browse(cr, uid, holidays_id, context=context):
result[holiday.employee_id.id]['current_leave_state'] = holiday.state