← Back to team overview

openerp-india team mailing list archive

[Bug 1167848] [NEW] wrong times on sign in/sign out

 

You have been subscribed to a public bug:

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')

** Affects: openobject-addons
     Importance: Undecided
         Status: New


** Tags: 6.1
-- 
wrong times on sign in/sign out
https://bugs.launchpad.net/bugs/1167848
You received this bug notification because you are a member of OpenERP Indian Team, which is subscribed to OpenERP Addons.