Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0030900 | Openbravo ERP | Z. Others | public | 2015-09-23 16:22 | 2015-09-23 16:22 |
Reporter | rbianchini | ||||
Assigned To | Triage Omni OMS | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | OS | 5 | OS Version | ||
Product Version | 3.0PR15Q1.4 | ||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | |||||
Web browser | |||||
Modules | Core | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0030900: Widget with null Date field cannot be exported | ||||
Description | When a widget that has a date column that is an optional column which can be null, if you try to export the data to CSV, you will encounter a error that the CSV file contains only: {"response":{"status":-4,"error":{"message":"Cannot format given Object as a Date","type":"system"}}} The stacktrace shows: ERROR org.openbravo.service.datasource.DataSourceServlet - Cannot format given Object as a Date java.lang.IllegalArgumentException: Cannot format given Object as a Date at java.text.DateFormat.format(DateFormat.java:281) at java.text.Format.format(Format.java:140) at org.openbravo.client.querylist.QueryListDataSource.getData(QueryListDataSour ce.java:270) at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetchJSONObject(R eadOnlyDataSourceService.java:137) at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetch(ReadOnlyDat aSourceService.java:116) at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet ..java:251) at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet. java:754) and so on .. | ||||
Steps To Reproduce | Create a widjet with an optional column date which can be null. Try to export to CSV Observes the error in the CSV file | ||||
Proposed Solution | Apply this patch: diff --git a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java --- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java +++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java @@ -267,9 +267,10 @@ || (!isExport && queryAliases[i].equals(column.getLinkExpression()))) { Object value = resultList[i]; if (domainType instanceof DateDomainType || domainType instanceof DateDomainType) { + if (value != null) { value = xmlDateFormat.format(value); } - else if (value instanceof Timestamp) { + } else if (value instanceof Timestamp) { value = xmlDateTimeFormat.format(value); value = JsonUtils.convertToCorrectXSDFormat((String) value); } | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-09-23 16:22 | rbianchini | New Issue | |||
2015-09-23 16:22 | rbianchini | Assigned To | => Triage Finance | ||
2015-09-23 16:22 | rbianchini | Modules | => Core | ||
2015-09-23 16:22 | rbianchini | Triggers an Emergency Pack | => No |
There are no notes attached to this issue. |