Skip to content
Snippets Groups Projects
Commit 16a96921 authored by Ravish Murari's avatar Ravish Murari Committed by Martin Trigaux
Browse files

[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
parent 8973217e
Branches
Tags
No related merge requests found
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment