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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027630
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2014-09-17 17:442014-09-22 09:14
Reportereduardo_ArgalView Statuspublic 
Assigned ToAugustoMauch 
PriorityurgentResolutionfixedFixed in Version3.0PR14Q4
StatusclosedFix in branchFixed in SCM revision6e24dd2e0fe8
ProjectionnoneETAnoneTarget Version3.0PR14Q4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toshankarb
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027630: Wrong date format grids using Process Definition

DescriptionUsing HQL Datasources to build a grid inside a process definition window, add a field in the grid as DateTime.
Having a field defined as DateTime, this one shows up in the grid as a Date.
Steps To ReproduceUse this branch:

https://code.openbravo.com/erp/devel/pi-reconref [^]

As F&B Admin:
- Open the Financial Account window
- Select a bank account
- Create a Bank Statement Header. Enter any name.
- Create a Bank Statement Line. Enter any reference No, and any amount in other than 0.
- Process the Bank Statement
- Press the Match Statement button
- Press cancel when asked about executing algorithm
- Right click on the grid headers to add the bslUpdated field. Its reference is DateTime. Realize that the content is a Date without time, this is wrong.
Proposed SolutionHave a look at the attached diff which solves the problem.
there are two if statements which are in wrong order.
First wraps second so second is never used (Date wraps DateTime as DateTime is as well a Date).
TagsNo tags attached.
Attached Filesdiff file icon DataToJsonConverter_Fix.diff [^] (794 bytes) 2014-09-17 17:44 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0070199)
hgbot (developer)
2014-09-18 18:20

Repository: erp/devel/pi
Changeset: 6e24dd2e0fe8f9d3192487681284b8bd590c3194
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Sep 18 18:18:22 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6e24dd2e0fe8f9d3192487681284b8bd590c3194 [^]

Fixes issue 27630: The proper date format is used in Pick and Execute windows

When a datetime field was shown in a P&E window, the date format was used, instead of the datetime format. This happened because of this bug in the DataToJsonConverter.convertPrimitiveValue():

    ...
    if (value instanceof Date) {
      return xmlDateFormat.format(value);
    }
    if (value instanceof Timestamp) {
      return xmlDateTimeFormat.format(value);
    }
    ...

Timestamp is a subclass of Date, so all values that are instance of Timestamp are also instance of Date. This means that if the value attribute contains a datetime, the execution flow will enter in the first if statement, and the date format will be used.

This bug is fixed by checking first by checking first if the value is an instance of Timestamp before checking if it is an instance of Date.

This bug was not reproducible ins standard grids because this function is only called when using ReadOnlyDataSources.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
---
(0070217)
hudsonbot (developer)
2014-09-19 20:23

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/af234b76a941 [^]
Maturity status: Test
(0070220)
shankarb (reporter)
2014-09-22 09:14

Code reviewed and verified in pi changeset 99b060690c1f.

- Issue History
Date Modified Username Field Change
2014-09-17 17:44 eduardo_Argal New Issue
2014-09-17 17:44 eduardo_Argal Assigned To => AugustoMauch
2014-09-17 17:44 eduardo_Argal Modules => Core
2014-09-17 17:44 eduardo_Argal Triggers an Emergency Pack => No
2014-09-17 17:44 eduardo_Argal File Added: DataToJsonConverter_Fix.diff
2014-09-18 18:02 AugustoMauch Steps to Reproduce Updated View Revisions
2014-09-18 18:19 AugustoMauch Issue Monitored: shankarb
2014-09-18 18:19 AugustoMauch Review Assigned To => shankarb
2014-09-18 18:20 hgbot Checkin
2014-09-18 18:20 hgbot Note Added: 0070199
2014-09-18 18:20 hgbot Status new => resolved
2014-09-18 18:20 hgbot Resolution open => fixed
2014-09-18 18:20 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6e24dd2e0fe8f9d3192487681284b8bd590c3194 [^]
2014-09-19 20:23 hudsonbot Checkin
2014-09-19 20:23 hudsonbot Note Added: 0070217
2014-09-22 09:14 shankarb Note Added: 0070220
2014-09-22 09:14 shankarb Status resolved => closed
2014-09-22 09:14 shankarb Fixed in Version => 3.0PR14Q4


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker