Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027630Openbravo ERPA. Platformpublic2014-09-17 17:442014-09-22 09:14
eduardo_Argal 
AugustoMauch 
urgentmajoralways
closedfixed 
5
 
3.0PR14Q43.0PR14Q4 
shankarb
Core
No
0027630: Wrong date format grids using Process Definition
Using 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.
Use 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.
Have 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).
No tags attached.
diff DataToJsonConverter_Fix.diff (794) 2014-09-17 17:44
https://issues.openbravo.com/file_download.php?file_id=7256&type=bug
Issue History
2014-09-17 17:44eduardo_ArgalNew Issue
2014-09-17 17:44eduardo_ArgalAssigned To => AugustoMauch
2014-09-17 17:44eduardo_ArgalModules => Core
2014-09-17 17:44eduardo_ArgalTriggers an Emergency Pack => No
2014-09-17 17:44eduardo_ArgalFile Added: DataToJsonConverter_Fix.diff
2014-09-18 18:02AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6596#r6596
2014-09-18 18:19AugustoMauchIssue Monitored: shankarb
2014-09-18 18:19AugustoMauchReview Assigned To => shankarb
2014-09-18 18:20hgbotCheckin
2014-09-18 18:20hgbotNote Added: 0070199
2014-09-18 18:20hgbotStatusnew => resolved
2014-09-18 18:20hgbotResolutionopen => fixed
2014-09-18 18:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6e24dd2e0fe8f9d3192487681284b8bd590c3194 [^]
2014-09-19 20:23hudsonbotCheckin
2014-09-19 20:23hudsonbotNote Added: 0070217
2014-09-22 09:14shankarbNote Added: 0070220
2014-09-22 09:14shankarbStatusresolved => closed
2014-09-22 09:14shankarbFixed in Version => 3.0PR14Q4

Notes
(0070199)
hgbot   
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   
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   
2014-09-22 09:14   
Code reviewed and verified in pi changeset 99b060690c1f.