[IMP]: hr_holidays: Improved warning message and added proper tooltip for remaining_leaves field

bzr revid: rpa@tinyerp.com-20110607115447-ktyc2dufwgzt7rmp
This commit is contained in:
Rucha (Open ERP)
2011-06-07 17:24:47 +05:30
parent 4060d1d3fa
commit 90aaaa3c89
+3 -3
View File
@@ -334,7 +334,7 @@ class hr_employee(osv.osv):
# Find for holidays status
status_ids = type_obj.search(cr, uid, [('limit', '=', False)], context=context)
if len(status_ids) != 1 :
raise osv.except_osv(('warning !'),_("To use this feature, you should have only one leave type without the option 'Allow to Override Limit' set (%s Found).") % (len(status_ids)))
raise osv.except_osv(('Warning !'),_("To use this feature, you must have only one leave type without the option 'Allow to Override Limit' set. (%s Found).") % (len(status_ids)))
status_id = status_ids and status_ids[0] or False
if not status_id:
return False
@@ -349,7 +349,7 @@ class hr_employee(osv.osv):
return True
def _get_remaining_days(self, cr, uid, ids, name, args, context=None):
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")
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 = {}
for r in res:
@@ -361,7 +361,7 @@ class hr_employee(osv.osv):
_columns = {
'remaining_leaves': fields.function(_get_remaining_days, method=True, string='Remaining Leaves', fnct_inv=_set_remaining_days, type="float", help='Remaining Leaves', store=True),
'remaining_leaves': fields.function(_get_remaining_days, method=True, string='Remaining Leaves', fnct_inv=_set_remaining_days, type="float", help='Total number of legal leaves allocated to this employee, change this value to create allocation request.', store=True),
}
hr_employee()