[IMP] hr_holidays: show the number of remaining days in the dropdown of leave types.
bzr revid: tpa@tinyerp.com-20121107112807-yb3g23qk0hy13lxy
This commit is contained in:
parent
aabb0f38fa
commit
bc6747de0b
|
@ -90,6 +90,19 @@ class hr_holidays_status(osv.osv):
|
||||||
'color_name': 'red',
|
'color_name': 'red',
|
||||||
'active': True,
|
'active': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def name_get(self, cr, uid, ids, context=None):
|
||||||
|
if not ids:
|
||||||
|
return []
|
||||||
|
reads = self.read(cr, uid, ids, ['name', 'remaining_leaves'], context=context)
|
||||||
|
res = []
|
||||||
|
for record in reads:
|
||||||
|
name = record['name']
|
||||||
|
if record['remaining_leaves']:
|
||||||
|
name = name + ' (' +str(record['remaining_leaves']) + ')'
|
||||||
|
res.append((record['id'], name))
|
||||||
|
return res
|
||||||
|
|
||||||
hr_holidays_status()
|
hr_holidays_status()
|
||||||
|
|
||||||
class hr_holidays(osv.osv):
|
class hr_holidays(osv.osv):
|
||||||
|
|
Loading…
Reference in New Issue