[FIX] hr_timesheet_sheet: avoid error when sort attendances
When an attendance line is edited, the tuple has no key 'name' which lead to a traceback. Fixes #546
This commit is contained in:
parent
8973217ea7
commit
16a969214f
|
@ -106,7 +106,10 @@ class hr_timesheet_sheet(osv.osv):
|
|||
for att_tuple in attendance_tuples:
|
||||
if att_tuple[0] in [0,1,4]:
|
||||
if att_tuple[0] in [0,1]:
|
||||
name = att_tuple[2]['name']
|
||||
if att_tuple[2] and att_tuple[2].has_key('name'):
|
||||
name = att_tuple[2]['name']
|
||||
else:
|
||||
name = self.pool['hr.attendance'].browse(cr, uid, att_tuple[1]).name
|
||||
else:
|
||||
name = self.pool['hr.attendance'].browse(cr, uid, att_tuple[1]).name
|
||||
date_attendances.append((1, name, att_tuple))
|
||||
|
|
Loading…
Reference in New Issue