[FIX] hr_timesheet_sheet : date interval corrected for attendances
authorJay (Open ERP) <jvo@tinyerp.com>
Tue, 30 Jun 2009 15:11:37 +0000 (20:41 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Tue, 30 Jun 2009 15:11:37 +0000 (20:41 +0530)
lp bug: https://launchpad.net/bugs/393798 fixed

bzr revid: jvo@tinyerp.com-20090630151137-hrcfrqavdi2zlz7a

addons/hr_timesheet_sheet/hr_timesheet_sheet.py

index 17eabbc..9d8bdb1 100644 (file)
@@ -503,8 +503,8 @@ class hr_attendance(osv.osv):
                     LEFT JOIN (hr_attendance a \
                         LEFT JOIN hr_employee e \
                             ON (a.employee_id = e.id)) \
-                        ON (s.date_to >= a.name \
-                            AND s.date_from <= a.name \
+                        ON (s.date_to >= a.name::date \
+                            AND s.date_from <= a.name::date \
                             AND s.user_id = e.user_id) ' + \
                 qu1, qu2)
         res = cursor.fetchall()
@@ -623,8 +623,8 @@ class hr_timesheet_sheet_sheet_day(osv.osv):
                                     LEFT JOIN hr_employee e
                                     ON (s.user_id = e.user_id))
                                 ON (a.employee_id = e.id
-                                    AND s.date_to >= a.name
-                                    AND s.date_from <= a.name)
+                                    AND s.date_to >= a.name::date
+                                    AND s.date_from <= a.name::date)
                             WHERE action in ('sign_in', 'sign_out')
                             group by a.name::date, s.id
                         )) AS foo