Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037451Openbravo ERPA. Platformpublic2017-12-11 16:052018-02-22 18:19
samuel_nicuesa 
AugustoMauch 
highmajoralways
closedfixed 
5
 
3.0PR18Q2 
caristu
Core
No
0037451: Adaptive filtering is not applying the Country.Language filter properly
Language filter is not working properly when there are other filters applied.
In this case we are using currency and language fields to apply the filter.
Login in the ERP using F&B International group admin role.
- Open country and region window.
- Select AED in currency filter. Only one country uses that currency. The result fit in the first page, so if more filters are applied, adaptive filtering will be used.
- Select Arabic in language filter. It shows the message "The applied filter resulted in 0 result" but there is actually one record to show. This is wrong.
- Click on the Refresh toolbar button to force the criteria to be evaluated on the back end. It will return one record as expected.
No tags attached.
duplicate of defect 0037097 closed platform Adaptive Filter by ID not working properly with table references using a not ID column as key column 
has duplicate defect 0037452 closed platform Language filter is not working properly when there are few records on the grid. 
Issue History
2017-12-11 16:05samuel_nicuesaNew Issue
2017-12-11 16:05samuel_nicuesaAssigned To => platform
2017-12-11 16:05samuel_nicuesaModules => Core
2017-12-11 16:05samuel_nicuesaResolution time => 1514761200
2017-12-11 16:05samuel_nicuesaTriggers an Emergency Pack => No
2017-12-11 16:21samuel_nicuesaRelationship addedrelated to 0037452
2017-12-12 10:14inigosanchezStatusnew => scheduled
2017-12-12 10:14inigosanchezAssigned Toplatform => inigosanchez
2018-02-01 19:54inigosanchezAssigned Toinigosanchez => platform
2018-02-01 19:54inigosanchezStatusscheduled => acknowledged
2018-02-05 09:42AugustoMauchAssigned Toplatform => AugustoMauch
2018-02-05 09:51AugustoMauchSummaryLanguage filter is not working properly when there are other filters applied. => Adaptive filtering is not applying the Country.Language filter properly
2018-02-05 09:51AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16623#r16623
2018-02-05 09:51AugustoMauchStatusacknowledged => scheduled
2018-02-06 19:10AugustoMauchReview Assigned To => caristu
2018-02-06 19:19hgbotCheckin
2018-02-06 19:19hgbotNote Added: 0102226
2018-02-06 19:19hgbotStatusscheduled => resolved
2018-02-06 19:19hgbotResolutionopen => fixed
2018-02-06 19:19hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8725b521c897ab3b2ae18bd09adeefadc7c993c1 [^]
2018-02-06 19:19hgbotCheckin
2018-02-06 19:19hgbotNote Added: 0102227
2018-02-07 13:03AugustoMauchRelationship replacedhas duplicate 0037452
2018-02-07 14:12caristuRelationship addedduplicate of 0037097
2018-02-12 14:19caristuNote Added: 0102334
2018-02-12 14:19caristuStatusresolved => closed
2018-02-12 14:19caristuFixed in Version => 3.0PR18Q2
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102725
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102726

Notes
(0102226)
hgbot   
2018-02-06 19:19   
Repository: erp/devel/pi
Changeset: 8725b521c897ab3b2ae18bd09adeefadc7c993c1
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 06 19:08:50 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8725b521c897ab3b2ae18bd09adeefadc7c993c1 [^]

Fixes issue 37451: Fixes filtering of fks that dont use ids as key

The problem was that the foreign keys that did not use and id column as key (i.e. ad_country.ad_language) were not being properly
filtered locally in smartclient, because the criteria used the id of the referenced record, that was not available in the browser (it
was available in the query done in the back end, that is why only the client-side filtering was not working).

For instance, if the ad_language foreign key reference uses as key ad_language.ad_language instead of ad_language.ad_language_id, the criteria
will no longer be:

{
  fieldName: 'language',
  operator: 'equals',
  value: '192'
}

Now it will be:

{
  fieldName: 'language',
  operator: 'equals',
  value: 'en_US'
}

The AdvancedQueryBuilder has been adapted to support the new type of criteria.

There are also changes on ob-grid.js and ob-formitem-fk-filter to ensure that the criteria is properly displayed in the filter input.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/ForeignKeyUIDefinition.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
(0102227)
hgbot   
2018-02-06 19:19   
Repository: erp/devel/pi
Changeset: e15a97093931f2d1d52e7225643a63db53baef79
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 06 19:10:21 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e15a97093931f2d1d52e7225643a63db53baef79 [^]

Related with issue 37451: Adds tests

Tests have been added to check that the datasource returns properly the results using the updated criteria.

Selenium tests with the current infrastructure are not possible, since when they filter the grid, they do not
select the checkboxes of the foreign key combo boxes, they just enter the text in the filter input, and if done
that way the issue is not reproducible.

---
M src-test/src/org/openbravo/test/AllWebserviceTests.java
A src-test/src/org/openbravo/test/datasource/NonIdForeignKeyFilters.java
---
(0102334)
caristu   
2018-02-12 14:19   
Code reviewed + tested OK.
(0102725)
hudsonbot   
2018-02-22 18:19   
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/980a6ad5bbf5 [^]
Maturity status: Test
(0102726)
hudsonbot   
2018-02-22 18:19   
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/980a6ad5bbf5 [^]
Maturity status: Test