Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022971Openbravo ERP00. Application dictionarypublic2013-02-04 18:142013-02-20 04:49
caristu 
AugustoMauch 
urgentmajoralways
closedfixed 
5
pi 
3.0MP213.0MP21 
shankarb
Core
No
0022971: Export as CSV is not working properly on Widgets if it contains null values
If we create a widget that has a column with null values and we export it as csv, the resulting file is not properly generated.

There are two situations:

a) If all the values in the column are null, then the column is not exported
b) If some of the values are not null, then the column is not exported too and the not null values are not correctly placed (see attachments)
1) As [system administrator], go to [Widget] window and create a new Query/List widget. In the Query tab, insert an hql query with a column that contains null values

2) Add the widget to the [Workspace]

3) Click on the pencil button of the widget and choose 'Export as CSV'
No tags attached.
csv wrongExportation.csv (881) 2013-02-04 23:07
https://issues.openbravo.com/file_download.php?file_id=5932&type=bug
diff issue22971.diff (812) 2013-02-05 12:21
https://issues.openbravo.com/file_download.php?file_id=5934&type=bug
Issue History
2013-02-04 18:14caristuNew Issue
2013-02-04 18:14caristuAssigned To => AugustoMauch
2013-02-04 18:14caristuModules => Core
2013-02-04 18:14caristuTriggers an Emergency Pack => No
2013-02-04 18:18caristuPriorityurgent => immediate
2013-02-04 18:26caristuResolution time => 1360018800
2013-02-04 18:26caristuversion => pi
2013-02-04 18:26caristuTarget Version => 3.0MP21
2013-02-04 23:07caristuFile Added: wrongExportation.csv
2013-02-05 12:21AugustoMauchFile Added: issue22971.diff
2013-02-05 12:22AugustoMauchNote Added: 0056157
2013-02-05 12:22AugustoMauchStatusnew => scheduled
2013-02-05 12:22AugustoMauchfix_in_branch => pi
2013-02-06 11:45jonalegriaesarteNote Added: 0056219
2013-02-06 11:45jonalegriaesartePriorityimmediate => urgent
2013-02-06 11:45jonalegriaesartefix_in_branchpi =>
2013-02-11 17:38AugustoMauchIssue Monitored: shankarb
2013-02-11 17:39AugustoMauchReview Assigned To => shankarb
2013-02-11 17:44hgbotCheckin
2013-02-11 17:44hgbotNote Added: 0056345
2013-02-11 17:44hgbotStatusscheduled => resolved
2013-02-11 17:44hgbotResolutionopen => fixed
2013-02-11 17:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cf082b976da9ff9afb08de39d9f1a3c0cdc1f583 [^]
2013-02-12 11:52shankarbNote Added: 0056369
2013-02-12 11:52shankarbStatusresolved => closed
2013-02-12 11:52shankarbFixed in Version => 3.0MP21
2013-02-20 04:49hudsonbotCheckin
2013-02-20 04:49hudsonbotNote Added: 0056568

Notes
(0056157)
AugustoMauch   
2013-02-05 12:22   
A fix for this issue has been attached. It will be pushed to pi once it is unfrozen for MP21 issues.
(0056219)
jonalegriaesarte   
2013-02-06 11:45   
Patch provided, changing the priority
(0056345)
hgbot   
2013-02-11 17:44   
Repository: erp/devel/pi
Changeset: cf082b976da9ff9afb08de39d9f1a3c0cdc1f583
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Feb 11 17:44:28 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/cf082b976da9ff9afb08de39d9f1a3c0cdc1f583 [^]

Fixes issue 22971: Columns with null values can be exported to CSV

The problem was that the convertPrimitiveValue method of the DataToJsonConverter class was returning null when a null object was provided. If then that null object is used in the JSONObject.put(key, value) in the value field, the field was not added at all.

This has been fixed by returning an empty string instead of a null object.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
---
(0056369)
shankarb   
2013-02-12 11:52   
Code Reviewed and Verified in pi changeset 5265a23b7dbe
(0056568)
hudsonbot   
2013-02-20 04:49   
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/d828167a9e83 [^]

Maturity status: Test