Fix _sheet function in timesheet when called with a list of non unique id
authorced <>
Thu, 13 Dec 2007 13:39:42 +0000 (13:39 +0000)
committerced <>
Thu, 13 Dec 2007 13:39:42 +0000 (13:39 +0000)
bzr revid: ced-0077ba46e97cd7b1afbfe1a9fed3096a0d7bef4c

addons/hr_timesheet_sheet/hr_timesheet_sheet.py

index a807521..7a6ace0 100644 (file)
@@ -314,7 +314,7 @@ class hr_timesheet_line(osv.osv):
                                context=context):
                        sheet_names[sheet_id] = name
 
-               for line_id in ids:
+               for line_id in {}.fromkeys(ids):
                        sheet_id = res.get(line_id, False)
                        if sheet_id:
                                res[line_id] = (sheet_id, sheet_names[sheet_id])
@@ -433,7 +433,7 @@ class hr_attendance(osv.osv):
                                context=context):
                        sheet_names[sheet_id] = name
 
-               for line_id in ids:
+               for line_id in {}.fromkeys(ids):
                        sheet_id = res.get(line_id, False)
                        if sheet_id:
                                res[line_id] = (sheet_id, sheet_names[sheet_id])