Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027246Openbravo ERP00. Application dictionarypublic2014-07-31 09:302014-08-17 15:32
mtaal 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
 
mtaal
Core
No
0027246: Error when setting count function in analytics window
See screenshot, apparently this query has an error:
 select count(e.salesOrder.documentNo + join_1.orderDate + join_1.grandTotalAmount) from OBANALY_FACT_ORDER as e left join e.salesOrderLine as join_0 left join join_0.salesOrder as join_1 where ( ( e.lineCost > :alias_0 ) ) and e.organization.id in ('BE0AC4CFA26F4F408FD407033E4BFCF9', '9DB2E1269F0149EDBD0D00C53C7DAC73', '4525CC3279774C89AC745FE7627C701C', '504FD243C72E40ABBA834C73B5667EF7', '7C4A8703014F416CB5222163B9DB1BFE', '05830B2BCB9D477B9A3F22082634DFFF', '6C32D1DF2D504ADCA4FC5ABCFCDA18FF', 'BF22A3C7C9CD4F70814D871A2E4EE7A2', '6049CE77D04845969D328CA3731F033F', '2AA41098B0AA47C791B92AE5B1D40A99', 'DDD786B5320F4B19B19661A9CDBF74EA', '18164FB16A334FC8BF449DE217284031', 'E0522AE6B2EA446D85FD69B5CC416826', 'C11EF9BFAC03464C9B9E6925C0EE7F8C', 'C11077EB595D403AA87AFEBCC45CD83D', '387E977F25204A4DB5B6BED50554B168', '02BC27FC439147F6BB1DF655D03623C0', 'FB6777E278FD4ED08F9384450FEA3845', '5F0478879DED4E2CBF387B35A779569E', '0', 'B1269F493B1342BE8B4B75D11B995E0E', '83A0BB79EEDA4ECCB4BCFDF1A9A09466', 'C069750FD29C46BF98A0F1126496C711') and e.client.id in ('A65074D0843147BEB4F13FF007B52F0A', '0')
- open analytics details window
- set a summary function on a column
- reload
No tags attached.
png Selection_009.png (207,546) 2014-07-31 09:30
https://issues.openbravo.com/file_download.php?file_id=7111&type=bug
png

png AnalyticsCount.png (131,519) 2014-08-12 15:11
https://issues.openbravo.com/file_download.php?file_id=7131&type=bug
png
Issue History
2014-07-31 09:30mtaalNew Issue
2014-07-31 09:30mtaalAssigned To => mtaal
2014-07-31 09:30mtaalFile Added: Selection_009.png
2014-08-12 15:09AugustoMauchAssigned Tomtaal => AugustoMauch
2014-08-12 15:10AugustoMauchNote Added: 0069316
2014-08-12 15:10AugustoMauchStatusnew => feedback
2014-08-12 15:11AugustoMauchFile Added: AnalyticsCount.png
2014-08-12 15:14mtaalNote Added: 0069317
2014-08-13 08:30AugustoMauchNote Added: 0069332
2014-08-13 08:30AugustoMauchStatusfeedback => new
2014-08-13 10:07AugustoMauchProjectModules => Openbravo ERP
2014-08-13 10:10AugustoMauchNote Added: 0069336
2014-08-13 10:16AugustoMauchIssue Monitored: mtaal
2014-08-13 10:16AugustoMauchReview Assigned To => mtaal
2014-08-13 10:16AugustoMauchModules => Core
2014-08-13 10:16AugustoMauchTriggers an Emergency Pack => No
2014-08-13 10:16AugustoMauchCategoryAnalytics => 00. Application dictionary
2014-08-13 10:16hgbotCheckin
2014-08-13 10:16hgbotNote Added: 0069337
2014-08-13 10:16hgbotStatusnew => resolved
2014-08-13 10:16hgbotResolutionopen => fixed
2014-08-13 10:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ce5524b59abfc64fd83bfb86b4f919e51ca3c897 [^]
2014-08-14 04:01hudsonbotCheckin
2014-08-14 04:01hudsonbotNote Added: 0069360
2014-08-17 15:32mtaalNote Added: 0069424
2014-08-17 15:32mtaalStatusresolved => closed

Notes
(0069316)
AugustoMauch   
2014-08-12 15:10   
I can't reproduce the issue. The count summary function works properly in the Analytics Sales Detail View window, see attached screenshot.
(0069317)
mtaal   
2014-08-12 15:14   
Hey Augusto,
One thing is that I had set a filter in the cost colum with: > 0
so it shows all the records with cost larger than 0

Can you try that?

gr. Martin
(0069332)
AugustoMauch   
2014-08-13 08:30   
I can reproduce by setting the summary field in the Sales Order Line column.
(0069336)
AugustoMauch   
2014-08-13 10:10   
This happens when the column used in the count summary function points to a table that has at least one non-primitive identifier property that points to another table that has more than one identifier property (primitive or non-primitive).

In this case, the identifier of Sales Order Line uses the identifier of Sales Order, which has three identifier properties.
(0069337)
hgbot   
2014-08-13 10:16   
Repository: erp/devel/pi
Changeset: ce5524b59abfc64fd83bfb86b4f919e51ca3c897
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Aug 13 10:15:49 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ce5524b59abfc64fd83bfb86b4f919e51ca3c897 [^]

Fixes issue 27246: Error when setting count function in analytics window

The problem was that a select clause like this was being used in a HQL query:
* select count(e.salesOrder.documentNo + join_1.orderDate + join_1.grandTotalAmount) from ...

Property concatenation is not supported in a count function, it does not even make sense. To fix this, the addSelectFunctionPart method of AdvancedQueryBuilder has been updated so that '*' is always used inside the count function.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
(0069360)
hudsonbot   
2014-08-14 04:01   
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/39d7672e843c [^]
Maturity status: Test
(0069424)
mtaal   
2014-08-17 15:32   
Works!