From 8dc08fabe703bca2af7508469a7011188f5c1ba8 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Wed, 22 Jun 2011 18:23:14 +0530 Subject: [PATCH] [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 --- addons/hr_holidays/hr_holidays.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 31d4aa50a1d..05d16277944 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -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 = {}