Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029174Openbravo ERPA. Platformpublic2015-03-06 14:332015-05-06 20:25
caristu 
AugustoMauch 
immediateminoralways
closedfixed 
5
pi 
3.0PR15Q23.0PR15Q2 
alostale
Core
Production - QA Approved
2014-07-11
3.0PR14Q4
https://code.openbravo.com/erp/devel/pi/rev/119c05bb76af1d1f6f681ac60a1c8eb3afe1a10c [^]
No
0029174: Summarize fields are not displayed in widgets
Summarize fields are not displayed in widgets. The following error appears in the log when obtaining the information of a widget with one of this fields:

2015-03-06 15:33:29,603 [ajp-localhost%2F127.0.0.1-8809-8] ERROR org.openbravo.service.datasource.DataSourceServlet -
java.lang.NullPointerException
    at org.hibernate.dialect.function.StandardAnsiSqlAggregationFunctions$SumFunction.determineJdbcTypeCode(StandardAnsiSqlAggregationFunctions.java:145)
    at org.hibernate.dialect.function.StandardAnsiSqlAggregationFunctions$SumFunction.getReturnType(StandardAnsiSqlAggregationFunctions.java:157)
1) Add the "Stock by Warehouse" widget in the Workspace
2) Notice that the summarize field (Sum) for the Quantity on Hand does not appear
No tags attached.
caused by defect 0026992 closed AugustoMauch "SUM" Summarize field does not show the total in widgets with huge quantity of data 
related to defect 0032604 closed alostale Stock by Warehouse widget logs error message 
related to defect 0032605 closed alostale widgets summary field not displayed if HQL has group by clause 
related to defect 0036004 acknowledged Triage Platform Base Review widget definitions included in the standard distribution 
causes design defect 0029741 acknowledged Triage Platform Base Summarize fields are not displayed in widgets when the query contains subqueries or uses functions 
png beforeQ4.png (67,675) 2015-03-06 14:33
https://issues.openbravo.com/file_download.php?file_id=7863&type=bug
png

png afterQ4.png (64,087) 2015-03-06 14:33
https://issues.openbravo.com/file_download.php?file_id=7864&type=bug
png
Issue History
2015-03-06 14:33caristuNew Issue
2015-03-06 14:33caristuAssigned To => AugustoMauch
2015-03-06 14:33caristuModules => Core
2015-03-06 14:33caristuRegression introduced in release => 3.0PR14Q4
2015-03-06 14:33caristuTriggers an Emergency Pack => No
2015-03-06 14:33caristuFile Added: beforeQ4.png
2015-03-06 14:33caristuFile Added: afterQ4.png
2015-03-06 14:43caristuIssue Monitored: networkb
2015-03-06 14:43caristuResolution time => 1432159200
2015-03-06 14:45caristuRegression level => Production - QA Approved
2015-03-06 14:46caristuversion => pi
2015-03-06 15:34caristuDescription Updatedbug_revision_view_page.php?rev_id=7888#r7888
2015-03-09 17:09AugustoMauchRegression date => 2014-07-11
2015-03-09 17:09AugustoMauchRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/119c05bb76af1d1f6f681ac60a1c8eb3afe1a10c [^]
2015-03-09 17:09AugustoMauchRelationship addedcaused by 0026992
2015-03-10 14:47alostaleNote Added: 0075397
2015-03-10 14:47alostaleAssigned ToAugustoMauch => caristu
2015-03-10 14:47alostaleStatusnew => feedback
2015-03-11 18:30AugustoMauchStatusfeedback => new
2015-03-11 18:30AugustoMauchAssigned Tocaristu => AugustoMauch
2015-03-11 18:30AugustoMauchStatusnew => acknowledged
2015-03-17 14:37alostaleAssigned ToAugustoMauch => platform
2015-03-17 18:52AugustoMauchAssigned Toplatform => AugustoMauch
2015-03-17 18:52AugustoMauchStatusacknowledged => scheduled
2015-03-17 18:52AugustoMauchIssue Monitored: alostale
2015-03-17 18:52AugustoMauchReview Assigned To => alostale
2015-03-17 18:53hgbotCheckin
2015-03-17 18:53hgbotNote Added: 0075698
2015-03-17 18:53hgbotStatusscheduled => resolved
2015-03-17 18:53hgbotResolutionopen => fixed
2015-03-17 18:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7c384195efacec360a20e17531acf50aaacf1038 [^]
2015-03-17 18:56hgbotCheckin
2015-03-17 18:56hgbotNote Added: 0075699
2015-03-17 18:56AugustoMauchNote Added: 0075700
2015-03-18 15:38hudsonbotCheckin
2015-03-18 15:38hudsonbotNote Added: 0075740
2015-03-23 08:24alostaleNote Added: 0075841
2015-03-23 08:24alostaleStatusresolved => closed
2015-03-23 08:24alostaleFixed in Version => 3.0PR15Q2
2015-04-29 19:21hgbotCheckin
2015-04-29 19:21hgbotNote Added: 0076888
2015-04-29 19:21hgbotCheckin
2015-04-29 19:21hgbotNote Added: 0076889
2015-04-29 20:18hgbotCheckin
2015-04-29 20:18hgbotNote Added: 0076894
2015-04-29 20:19caristuRelationship addedcauses 0029741
2015-04-29 20:21caristuNote Deleted: 0076888
2015-04-29 20:21caristuNote Deleted: 0076894
2015-04-29 20:21caristuNote Deleted: 0076889
2015-05-06 20:25eugeniIssue Monitored: eugeni
2016-04-05 16:09alostaleRelationship addedrelated to 0032604
2016-04-05 17:15alostaleRelationship addedrelated to 0032605
2017-05-16 11:24caristuRelationship addedrelated to 0036004

Notes
(0075397)
alostale   
2015-03-10 14:47   
Reported case is not standard: quantiy on hand column is already a sum in the query.

The SQL to get the total should look like

select sum(qtyOnHand)
  from (select sum(qtyOnHand)
          from ...)

which is not feasible with HQL (subqueries are not supported in the from clause).

Even this concrete case worked before fix for 0026992 when all records were in client, it didn't when other case.

Please provide actual customer's widget definition to understand the real case and decide on a possible solution.
(0075698)
hgbot   
2015-03-17 18:53   
Repository: erp/devel/pi
Changeset: 7c384195efacec360a20e17531acf50aaacf1038
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Mar 17 18:43:56 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7c384195efacec360a20e17531acf50aaacf1038 [^]

Fixes issue 29174: Changes the way summary fields work in widgets

Before this issue [1] was fixed, widget summary fields were computed in the front end, even if the grid had not loaded all the records. This behaviour was wrong, and to fix that issue i
t was decided to compute the summary fields in the backend, the same way it is done in standard grids.

The problem is that widget summary fields that used to show results before fixing [1] (remember that the result that were shown were not valid) do no longer work now, as it is not possi
ble to create a HQL to compute them in the server side. There were three types of summary fields that were not working:
  a) Those based on columns that had an alias in the HQL clause
  b) Those based on columns defined by a subquery
  c) Those based on columns defined in the HQL clase with a summary function

Columns defined like a) are now supported. In order to work they must have a proper value in its Where Clause Left Part field. Columns defined like b) and c) are now no longer supported
. If there is a column of these types in a widget, none of its summary fields will be shown, and a message will be shown in the log.

[1] https://issues.openbravo.com/view.php?id=26992 [^]

---
M modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java
---
(0075699)
hgbot   
2015-03-17 18:56   
Repository: erp/mods/com.openbravo.support.test
Changeset: 04f7dd013730a799821fbf55b395804fa9c81ca4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Mar 17 18:55:08 2015 +0100
URL: http://code.openbravo.com/erp/mods/com.openbravo.support.test/rev/04f7dd013730a799821fbf55b395804fa9c81ca4 [^]

Adds two widgets to test issue 29174

The first widget, called Test WIdget: Proper summary field, contains a supported summary field. The second widget, called Test Widget: Not proper summary field, conaints an unsupported sumary field, based on a subquery. When this widget is displayed the summary field is not shown and an error message is shown in the log.

---
M src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
A src-db/database/sourcedata/OBCQL_QUERY_COLUMN.xml
A src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
A src-db/database/sourcedata/OBKMO_WIDGET_CLASS.xml
---
(0075700)
AugustoMauch   
2015-03-17 18:56   
To test it use the widget defined here [1]

[1] https://code.openbravo.com/erp/mods/com.openbravo.support.test/rev/04f7dd013730 [^]
(0075740)
hudsonbot   
2015-03-18 15:38   
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/327af339611e [^]
Maturity status: Test
(0075841)
alostale   
2015-03-23 08:24   
code reviewed minor issues:
 * shouldn't exception logs [1] and [2] log also stack traces?
 * copyright for org.openbravo.client.querylist.QueryListDataSource should be updated

tested

[1] https://code.openbravo.com/erp/devel/pi/rev/7c384195efacec360a20e17531acf50aaacf1038#l2.33 [^]
[2] https://code.openbravo.com/erp/devel/pi/rev/7c384195efacec360a20e17531acf50aaacf1038#l2.38 [^]