wrong times on sign in/sign out

Bug #1167848 reported by Paulo Pinho
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

When a employee does "sign in" or "sign out" , the list view of attendance doesn't display the correct times .
In the other hand in the report "Attendance error report" the 'date signed' field appears correct but the 'date recorded' field is wrong.

the timezone of my server is " (UTC) Dublin, Edinburgh, lisbon, London " - Windows 7
the client side is the same " (UTC) Dublin, Edinburgh, lisbon, London " - windows 7 too

example:
The employee signs in at 9:00 AM Lisbon.

in the list view of attendance appears - 10:00 AM

in the database , on table hr_attendance
the 'create_date' field - 8:00 AM - The correct time in UTC
the 'name' field - 9:00 AM - The correct time in lisbon

if i create the report with timezone preference in blank the result is this:

    in the Attendance error report
                                      - Date Signed - 9:00 AM - The correct time in lisbon
                                      - Date Recorded - 8:00 AM - The correct time in UTC

if i create the report with timezone preference "Europe/Lisbon" the result is this

    in the Attendance error report
                                      - Date Signed - 10:00 AM - The time in lisbon plus my timezone preference(+1)
                                      - Date Recorded - 9:00 AM - The correct time in UTC plus my timezone preference(+1)

So the 'name' field is saved in my server's timezone is saved as a timestamp with no timezone information, but which is already offset to GMT. Then the offset is applied again for some reason. The create_date shows the correct time in UTC because it may be managed by openERP itself. I'm not sure.

----------------------------------------------
Solution

in the module hr_timesheet_sheet .
file - hr_timesheet_sheet.py
class -class hr_attendance(osv.osv):
method - def _get_default_date(self, cr, uid, context=None):

change the line :
    return time.strftime('%Y-%m-%d %H:%M:%S')
to
    return datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')

Tags: 6.1
affects: hr-timesheet → openobject-addons
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.