Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020684
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2012-06-06 09:402012-06-27 05:28
ReporteralostaleView Statuspublic 
Assigned ToAugustoMauch 
PriorityimmediateResolutionfixedFixed in Version3.0MP13
StatusclosedFix in branchFixed in SCM revisioneec8991a4efd
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0020684: Incorrect time in process request with different timezones in client/server

DescriptionHaving client and server in different time zones, time in process request window doesn't work properly.
Steps To ReproduceServer in UTC, client in UTC+2.

-Create a new process request in form view, start time: 10:00:00
-Go to grid view, start time is 9:00:00 -> incorrect
-Edit in grid, it changes back to 10:00:00
-Check how it was saved in server: it is 9:00:00-> incorrect: it should be 8:00:00 as it is the equivalent time in server timezone
-Check when the process is executed: it should be at 10:00 client time/8:00 server time
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00204963.0MP13 closedmigueldejuana The date on the process monitor window changes when moving from form to grid depending on the timezone 
related to defect 00185613.0MP7 closedalostale Time reference showed incorrectly in Process Request window 
related to defect 00204793.0MP13 closedmigueldejuana The filter on the startdate column on the process monitor grid is not working properly. 
related to defect 00207513.0MP13 closedAugustoMauch API change: time fields are sent in UTC 
related to defect 00208193.0MP13 closedAugustoMauch NullPointerException is thrown if a time is null 
related to defect 00249343.0MP31 closedAugustoMauch Columns with reference Time are not displayed/stored properly 

-  Notes
(0049753)
hgbot (developer)
2012-06-12 11:25

Repository: erp/devel/pi
Changeset: 976c8398def2e80de470ab55db222555d88566d8
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 12 11:24:28 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/976c8398def2e80de470ab55db222555d88566d8 [^]

Fixes issue 20684: Time fields are passed in UTC format

The problem was due to:
- Time fields were not being passed between client and server in UTC format
- When constructing a date based on a time (i.e. 10:00:00), the date used was 1970-01-01. This way, it was not possible to convert from UTC to local hour, because the DST offset depends
 on the date.

It has been fixed by:
- Sending the time fields in UTC format. Upon receiving a time field, converting it to local time.
- Upon receiving a time field, creating a new date using todays date instead of 1970-01-01
: Enter commit message. Lines beginning with 'HG:' are removed.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TimeUIDefinition.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java
---
(0049754)
AugustoMauch (developer)
2012-06-12 11:47

Summary of the changes:
- ob-formitem-time.js: When getting and setting a time field as a date, the current date is used, instead of 1970-01-01
- ob-view-form.js: In the editRecord function, sometimes the time fields will be in UTC format (when called from fetchDataReply) and other times (when claled from OBStandardView.editRecord) will be in local time format. If the time fields are in UTC format, they are converted to local time.
- ob-view-grid.js: When data is received from the datasource, convert the time fields from UTC to local time.
- ob-standard-view.js: When calling viewForm.editRecord, pass a new parameter that indicates that the time fields are in local time. When receiving a time, convert it to date using the current date.
- TimeUIDefinition.java: Overrides getFieldProperties to make sure that the time fields are passed to createFromClassicString in local time. Modifies createFromClassicString to make sure that time fields are sent to the client in UTC format.
- JSONUtils.java: A new time format has been created that does not contain the GMT offset.
- DataToJsonConverter.java. Time fields are stored in local time in the database, and converted to UTC before sending them to the client.
- JsonToDataConverter.java. Time fields are received in UTC format from the client, and converted to local time before storing them in the database.
(0049755)
AugustoMauch (developer)
2012-06-12 11:54

All the changes should only affect time fields, and they have been tested thoroughly, so I guess that this fix should not be risky.
(0049761)
AugustoMauch (developer)
2012-06-12 13:30

This fix has been tested with all possible client-server configurations:
- Both in the same time zone
- With a positive time zone difference
- With a negative time zone difference

The following has been tested in the Process Request window for each configuration:
- Show in grid the Start Time column
- Add a new record in grid view and save it.
- Open that record in form view, modify it and save it.
- Click refresh
- Add a new record in for view and save it.

In all cases the time shown is in client local time, it is sent to the server in UTC time and saved in the database in server local time.

- Create a process request to be executed at a specific time and schedule it. Check in Process Monitor that the process is executed at the time specified.
(0049774)
alostale (developer)
2012-06-12 16:52

Reopening issue after code review:

*ob-view-form.js: incorrect formatting (tabs and spaces)
*the fix assumes timezone difference of complete hours, not working for hour and minutes offsets.
(0049793)
hgbot (developer)
2012-06-13 10:11

Repository: erp/devel/pi
Changeset: eec8991a4efd7418ca88181f454f8a956ef77c38
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jun 13 13:55:34 2012 +0545
URL: http://code.openbravo.com/erp/devel/pi/rev/eec8991a4efd7418ca88181f454f8a956ef77c38 [^]

Fixes issue 20684: Hour and minutes time zone offset is supported

Instead of using the hour time zone offset, now the millisecond time zone offset is applied, supporting the time zones where the offset with UTC is measured in hours and minutes.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TimeUIDefinition.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java
---
(0049798)
hgbot (developer)
2012-06-13 10:54

Repository: erp/devel/pi
Changeset: c3c5bb6a8f84d5159d07776af1ad57975d79ec62
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jun 13 14:38:07 2012 +0545
URL: http://code.openbravo.com/erp/devel/pi/rev/c3c5bb6a8f84d5159d07776af1ad57975d79ec62 [^]

Related to issue 20684: Refactorization to remove duplicate code

The function convertUTCTimeToLocalTime and getTime fields of ob-view-grid and ob-view-form were very similar and shared much of its code. They code has been generalized and moved to OB.Utilities.Date

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js
---
(0049954)
hgbot (developer)
2012-06-20 17:04

Repository: erp/devel/pi
Changeset: 99602b3c2a1798756c847feeae94437babed2d9c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jun 20 17:03:55 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/99602b3c2a1798756c847feeae94437babed2d9c [^]

Fixes issue 20819. Related to issue 20684. NPE prevented.

A NullPointerException has been prevented by replacing columnValue.isEmpty() with StringUtils.isEmpty(columnValue), which returns true if columnValue is null, instead of throwing a NullPointerException.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TimeUIDefinition.java
---
(0050020)
alostale (developer)
2012-06-22 09:57

Code reviewed and verified on pi@889f630ff69d
(0050133)
hudsonbot (developer)
2012-06-27 05:28

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/cf3a7135839f [^]

Maturity status: Test

- Issue History
Date Modified Username Field Change
2012-06-06 09:40 alostale New Issue
2012-06-06 09:40 alostale Assigned To => alostale
2012-06-06 09:40 alostale Modules => Core
2012-06-06 09:41 alostale Relationship added related to 0020496
2012-06-06 09:41 alostale Priority normal => urgent
2012-06-06 09:41 alostale Description Updated View Revisions
2012-06-06 10:23 alostale Relationship added related to 0018561
2012-06-06 13:25 alostale Assigned To alostale => AugustoMauch
2012-06-06 13:26 alostale Priority urgent => immediate
2012-06-12 11:25 hgbot Checkin
2012-06-12 11:25 hgbot Note Added: 0049753
2012-06-12 11:25 hgbot Status new => resolved
2012-06-12 11:25 hgbot Resolution open => fixed
2012-06-12 11:25 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/976c8398def2e80de470ab55db222555d88566d8 [^]
2012-06-12 11:47 AugustoMauch Note Added: 0049754
2012-06-12 11:54 AugustoMauch Note Added: 0049755
2012-06-12 13:30 AugustoMauch Note Added: 0049761
2012-06-12 16:52 alostale Note Added: 0049774
2012-06-12 16:52 alostale Status resolved => new
2012-06-12 16:52 alostale Resolution fixed => open
2012-06-13 10:11 hgbot Checkin
2012-06-13 10:11 hgbot Note Added: 0049793
2012-06-13 10:11 hgbot Status new => resolved
2012-06-13 10:11 hgbot Resolution open => fixed
2012-06-13 10:11 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/976c8398def2e80de470ab55db222555d88566d8 [^] => http://code.openbravo.com/erp/devel/pi/rev/eec8991a4efd7418ca88181f454f8a956ef77c38 [^]
2012-06-13 10:26 alostale Relationship added related to 0020479
2012-06-13 10:54 hgbot Checkin
2012-06-13 10:54 hgbot Note Added: 0049798
2012-06-13 16:17 AugustoMauch Relationship added related to 0020751
2012-06-20 16:58 AugustoMauch Relationship added related to 0020819
2012-06-20 17:04 hgbot Checkin
2012-06-20 17:04 hgbot Note Added: 0049954
2012-06-22 09:57 alostale Note Added: 0050020
2012-06-22 09:57 alostale Status resolved => closed
2012-06-22 09:57 alostale Fixed in Version => 3.0MP13
2012-06-27 05:28 hudsonbot Checkin
2012-06-27 05:28 hudsonbot Note Added: 0050133
2013-10-24 11:30 mtaal Relationship added related to 0024934


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker