Comment 5 for bug 932584

Revision history for this message
Stuart Longland (redhatter) wrote : Re: [Bug 932584] Re: OpenERP 6.1rc1 emits working hours as local

Hi Amit,
On 13/03/12 17:29, Amit Parik (OpenERP) wrote:
> Hello Stuart,
>
> Yes, we have used a UTC format at server side for timezone.
> I have checked your bug report as well as patch, We understand it but we can not produce it. So it can not be accepted.
>
> That's why please provide appropriate steps to produce it.

Okay, the problem isn't difficult to reproduce, but requires some
modifications to OpenERP to dump what it emits to Faces for resource
levelling, or some critical analysis of the scheduling output.

If the code in the project_long_term module is modified to dump a copy
of the project it passes to Faces, you'll notice that the working hours
are in local time, but the tasks are in UTC.

Faces assumes that the working hours and the tasks are in the one time
zone, in fact, it knows nothing about time zones.

So supposing the hypothetical person is running UTC+10, and works a
9:00AM to 5:00PM working week. OpenERP is told that we work 9-5, tasks
get entered into OpenERP, the project manager clicks Schedule Tasks, and
what happens?

Faces schedules a 16 hour task to start at 0900 through to 1700, then
resume 0900 the next day. OpenERP picks up this schedule from Faces,
leaves it *as-is*, and enters it in as if it were UTC.

And so some poor sod is forced to start their working day at 7PM, work
through midnight, and aren't allowed to go home until 3AM, all because
Faces assumes all times are local time, and OpenERP assumes all times
are UTC.

A work around is to specify the hours in UTC directly. This could work,
however:

(1) It's unintuitive, why should an end user have to specify their
working hours as UTC when they can specify local time everywhere else?

(2) It doesn't work with the Faces library as distributed by OpenERP due
to a bug in Faces regarding shifts that span midnight -- attached to
this bug, and filed with upstream, is a fix to that very problem.

The only solution is to have both working hours and scheduling done in
the same time zone. I could have taken the approach of converting the
start and end times to/from the time zone of the user instead, but I
figured this approach was more consistent with the rest of the design of
OpenERP.

Regards,
--
Stuart Longland (aka Redhatter, VK4MSL) .'''.
Gentoo Linux/MIPS Cobalt and Docs Developer '.'` :
. . . . . . . . . . . . . . . . . . . . . . .'.'
http://dev.gentoo.org/~redhatter :.'

I haven't lost my mind...
  ...it's backed up on a tape somewhere.