[FIX] hr_attendance: use float division for worked_hours field
authorMaria G <mariagr@europeanstonetile.com>
Mon, 10 Nov 2014 00:11:16 +0000 (16:11 -0800)
committerMartin Trigaux <mat@odoo.com>
Wed, 26 Nov 2014 15:46:26 +0000 (16:46 +0100)
Used to be rounded to integer while the field is a float.
Fixes #3526

addons/hr_attendance/hr_attendance.py

index 4887d41..6b0960f 100644 (file)
@@ -68,7 +68,7 @@ class hr_attendance(osv.osv):
                     last_signin_datetime = datetime.strptime(last_signin.name, '%Y-%m-%d %H:%M:%S')
                     signout_datetime = datetime.strptime(obj.name, '%Y-%m-%d %H:%M:%S')
                     workedhours_datetime = (signout_datetime - last_signin_datetime)
-                    res[obj.id] = ((workedhours_datetime.seconds) / 60) / 60
+                    res[obj.id] = ((workedhours_datetime.seconds) / 60) / 60.0
                 else:
                     res[obj.id] = False
         return res