This issue touches two Modules (maybe more but in my case and this specific example this relates to 2 Modules)
If we have a Sign In before 08:00:00 (timezone is UTC +8)
- the Attendance (Sign In) is not shown under the filter "Today" but it appears under the day before
- an "Attendance Analysis" lists the whole Attendance (Sign In - Sign Out) under the prior day
- Sign In 2013-09-23 07:55:00
- Sign Out 2013-09-23 18:00:00
As far as I know OE uses UTC timecode for all entries in the database. The time you see in the interface is always calculated based on the UTC time. For example you input a Sign in at 11:00:00 your database entry will be 11 am - 8 hrs (if you are in the UTC +8 timezone as we are) = 03:00:00
And I am pretty convinced that this is where the problem lies ... If we have a Sign In before 08:00:00 (in our UTC+8 timezone) the system regards this as prior 00:00:00 (which logically is yesterday). Contrary to this inner logic it is pretty messing up things in the real world though. For example an employee gets to see an Attendance analysis which shows wrong days when he or she has worked. Also this must lead to double Attendances at one day with no attendance on the next day
- Monday Sign in 08:00 Sign out 16:00 Attendance Analysis = Mon 08:00 - 16:00
- Tuesday Sign in 07:59 Sign out 15:59 Attendance Analysis = Mon 07:59 - 15:59
No Attendance will be shown for Tuesday
I regard this as a bug but not sure how to file that (and how to solve it until it might get fixed). In my case I might force anybody to sign in not earlier then 8 (which luckily is our scheduled working time) but that is not a real solution naturally)
Yes as of now openERP is using all entries based on UTC , it save date value as +/- UTC in database , but while showing in view it's again convert the value to +/- UTC value Eg:- Am in a time zone 'Asia/Dubai' which is UTC +4
Sign In 2013-09-23 07:55:00(in UI) --> 2013-09-23 03:55:00(in DB)
I guess following is quick solution to some specific date time related entries , all that you need to do is use openERP's special context timestamp method to convert the datetime as follows.
now = fields.datetime.context_timestamp(cr, uid, datetime.now(), context=context)
will give u the datetime of the moment to signin as per your time zone.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 9/23/13, 9:40 AM|
|Seen: 2607 times|
|Last updated: 3/16/15, 8:10 AM|