Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036167Openbravo ERPA. Platformpublic2017-06-02 10:252017-09-21 16:49
dmiguelez 
alostale 
normalmajoralways
closedfixed 
5
 
3.0PR17Q4 
caristu
Core
No
0036167: Tree view of Tab is not correctly filtered if tab has where clause
If we enable the Tree view of a Tab with hundreds of records, it should work without any additional configuration (A preference can be created to modify this limit, but we should not need to enable it, we are working with less than 1000 records)

However, it is not working properly, the message:"This query criteria returns a number of nodes larger than the established limit. Please enter a more restrictive filter." is shown

It seems that the query is not being filtered properly.
In the Tab, there is a where clause with an expression containing an OR (something like x OR y). It seems that this may be one of the problems, since when building the query for the Tree, it is not isolating this expression between parenthesis, and the final expression looks like x OR y AND z, which does not match the original intent of the filter (x OR y) AND z
1. Apply the given patch (Configures a Tree view in Storage Bins Tab and allows to create 500 additional Bins)
2. Launch InventoryStatusTest.java class to create 500 additional Bins (This can be launched as any other JUnit test)
3. Login as QA Admin
4. Move to Warehouse and Storage Bins || Storage Bin Tab
5. Select any record and click on the Toggle Tree view button
6. The error message is shown
No tags attached.
diff issue.diff (4,732) 2017-06-02 10:25
https://issues.openbravo.com/file_download.php?file_id=10820&type=bug
diff proposal.diff (1,316) 2017-06-02 10:25
https://issues.openbravo.com/file_download.php?file_id=10821&type=bug
Issue History
2017-06-02 10:25dmiguelezNew Issue
2017-06-02 10:25dmiguelezAssigned To => platform
2017-06-02 10:25dmiguelezFile Added: issue.diff
2017-06-02 10:25dmiguelezModules => Core
2017-06-02 10:25dmiguelezTriggers an Emergency Pack => No
2017-06-02 10:25dmiguelezFile Added: proposal.diff
2017-06-02 10:27dmiguelezNote Added: 0097096
2017-06-02 12:29dmiguelezDescription Updatedbug_revision_view_page.php?rev_id=15282#r15282
2017-07-14 13:28alostaleSummaryTree view of Tab is not working with hundreds of records (the limit is supposed to be 1000 by default) => Tree view of Tab is not correctly filtered if tab has where clause
2017-07-14 13:33alostaleStatusnew => scheduled
2017-07-14 13:33alostaleAssigned Toplatform => alostale
2017-07-14 13:33alostaleReview Assigned To => caristu
2017-07-17 08:19hgbotCheckin
2017-07-17 08:19hgbotNote Added: 0098088
2017-07-17 08:19hgbotStatusscheduled => resolved
2017-07-17 08:19hgbotResolutionopen => fixed
2017-07-17 08:19hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/485d1a99a09df2e7501b785cd60bff6ea8fe06c4 [^]
2017-07-19 12:56caristuNote Added: 0098133
2017-07-19 12:56caristuStatusresolved => closed
2017-07-19 12:56caristuFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099274

Notes
(0097096)
dmiguelez   
2017-06-02 10:27   
An additional diff file has been attached with some fixes to some of the problems we've been able to see. But it is not a final solution.

The problem found and fix was related to how the query was built.
The fix is to isolate the Tab where clause in parentheses to avoid conflicts with the rest of the query that is being created.
(0098088)
hgbot   
2017-07-17 08:19   
Repository: erp/devel/pi
Changeset: 485d1a99a09df2e7501b785cd60bff6ea8fe06c4
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jul 14 13:33:10 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/485d1a99a09df2e7501b785cd60bff6ea8fe06c4 [^]

fixed bug 36167: Tree view is not correctly filtered if tab has where clause

  In case a tab that can be seen in tree mode, has a where clase with any OR, the
  query generated for the tree view, was not applying this wehere clause corretly
  because it didn't take into consideration operator precedence.

  Fixed by isolating tab's where clause in the genereted query.

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
---
(0098133)
caristu   
2017-07-19 12:56   
Code reviewed + testing OK.
(0099274)
hudsonbot   
2017-09-21 16: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/9750b78d3e5c [^]
Maturity status: Test