[REM,FIX]: hr_holidays: Removed checking for leave types in the get_remaining days function as it was giving error at the time of module installation, no need to put any exception in the function which compute data, it will return 0 if no leave type found

bzr revid: rpa@tinyerp.com-20110622125314-mn4jllnsbjwy2sd8
This commit is contained in:
Rucha (Open ERP) 2011-06-22 18:23:14 +05:30
parent 5baec6a299
commit 8dc08fabe7
1 changed files with 0 additions and 4 deletions

View File

@ -349,10 +349,6 @@ class hr_employee(osv.osv):
return True
def _get_remaining_days(self, cr, uid, ids, name, args, context=None):
type_obj = self.pool.get('hr.holidays.status')
status_ids = type_obj.search(cr, uid, [('limit', '=', False)], context=context)
if len(status_ids) != 1 :
raise osv.except_osv(_('Warning !'),_("You should have only one leave type without the option 'Allow to Override Limit' set. (%s Found).") % (len(status_ids)))
cr.execute("SELECT sum(h.number_of_days_temp) as days, h.employee_id from hr_holidays h join hr_holidays_status s on (s.id=h.holiday_status_id) where h.type='add' and h.state='validate' and s.limit=False group by h.employee_id")
res = cr.dictfetchall()
remaining = {}