[trunk/6.1] workorder planned end date calculated incorrectly (timezone issue)

Bug #1020977 reported by Jeroen Mollers
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP R&D Addons Team 2

Bug Description

OpenERP 6.1
Ubuntu 10.04

Steps to reproduce:
- create OpenERP 6.1 database with mrp, mrp_operations modules installed with demo data
- client timezone UTC +0200
- create a manufacturing order with a workorder for the Assembly Workshop
- the Assembly Workshop has a Working Time of 45 hrs/week (monday-friday 2 shifts: morning 08:00-12:00, evening 13:00-18:00)
- set workorder Nbr of hours to 03:00
- set workorder Scheduled Date to start at 08:00 on a weekday

Observed behaviour:
- End Date (planned) = 13:00

Expected behaviour:
- End Date (planned) = 11:00 (08:00 for morning start time + 03:00 production hours)

Suspected cause:
The planned end date is calculated by the interval_get_multi method of the resource_calendar object. This method calculates uses the planned start date in UTC and the Working Time to calculate a planned end date. This returned planned end date is still in UTC. When presenting the planned end date on screen the planned end date is converted to UTC +0200. The bug is caused by the assumption that the Working Time is in UTC. This is not the case. The Working Time is in localtime, which for me is UTC +0200. I think the interval_get_multi method of the resource_calendar object should somehow consider the local timezone in the scheduled end date calculations.

Jeroen Mollers

Tags: mrp
description: updated
tags: added: timezone
tags: removed: timezone
summary: - [6.1] workorder planned end date calculated incorrectly
+ [6.1] workorder planned end date calculated incorrectly (timezone issue)
description: updated
summary: - [6.1] workorder planned end date calculated incorrectly (timezone issue)
+ [trunk/6.1] workorder planned end date calculated incorrectly (timezone
+ issue)
Changed in openobject-addons:
importance: Undecided → Medium
status: New → Confirmed
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → nobody
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Note: this is related to bug 932584 (and corresponding OPW case #575797), the patch for the OPW case should solve both problems I think.

Revision history for this message
Jeroen Mollers (jmollers) wrote :

Hi Olivier,

Thanks for your post. I have tested the patch you mentioned. Unfortunately, the bug I described in my first post still occurs with the patch.

Note that Stuarts patch modifies the compute_working_calendar method of the resource_resource model. The end datetime calculation for workorders however uses the interval_get_multi method of the resource_calendar model. A fix similar to Stuart's one could be applied to this interval_get_multi method. This is complicated by the absence of a context parameter to interval_get_multi. This means a full fix would probably need the context to be passed all files that call the resource_calendar.interval_get_multi method.

If you need additional information please let me know.

Jeroen Mollers

Amit Parik (amit-parik)
tags: added: mrp
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.