Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031214Openbravo ERPA. Platformpublic2015-10-22 11:382015-11-23 21:16
AugustoMauch 
alostale 
immediateminorhave not tried
closedfixed 
5
 
3.0PR16Q1 
AugustoMauch
Core
Production - Confirmed Stable
2014-11-14
3.0PR15Q1
http://code.openbravo.com/erp/devel/pi/rev/84865a340443fbc6aa5c36d777c8c57df2f6525b [^]
No
0031214: Strange behaviour when refreshing a grid after filtering a product characteristic column
If the user filters a tab using a product characteristic column and then adds any other filter, the next time the grid is reloaded it be very slow.
== Prepare the data ==
As F&B Admin:
- Open the Product Characteristic window. Create one variant characteristic.
- In its Value subtab, create a record.
- Open the Product window. Create a new variant product.
- Add in its Characteristics subtab the characteristic you created in the previous step.
- Execute the Create Variants record and refresh the grid. Check that a new product has been created

== Actual Test ==
- In the product window, use the product characteristic filter to show only the records that have the characteristic you defined. This will work properly
- Click the refresh toolbar button. This will work properly
- Add any other filter (for instance, Active=Yes) and refresh the grid again. The tab will show the Loading Data message, but it will not actually load the data.

Note that if the filters are added in the reverse order (first any other than the product characteristic filter, then the product characteristic filter), it works fine.
No tags attached.
depends on backport 00312183.0PR15Q4 closed alostale Strange behaviour when refreshing a grid after filtering a product characteristic column 
depends on backport 00312193.0PR15Q3.3 closed alostale Strange behaviour when refreshing a grid after filtering a product characteristic column 
depends on backport 00312203.0PR15Q2.7 closed alostale Strange behaviour when refreshing a grid after filtering a product characteristic column 
caused by design defect 0025811 closed AugustoMauch unnecessary request on grid refresh 
Issue History
2015-10-22 11:38AugustoMauchNew Issue
2015-10-22 11:38AugustoMauchAssigned To => platform
2015-10-22 11:38AugustoMauchModules => Core
2015-10-22 11:38AugustoMauchTriggers an Emergency Pack => No
2015-10-22 11:38AugustoMauchRegression introduced in release => 3.0PR15Q1
2015-10-22 12:07alostaleNote Added: 0081200
2015-10-22 12:10alostaleNote Edited: 0081200bug_revision_view_page.php?bugnote_id=0081200#r9813
2015-10-22 14:23alostaleRelationship addedcaused by 0025811
2015-10-22 14:28alostaleNote Added: 0081212
2015-10-22 15:18alostaleStatusnew => scheduled
2015-10-22 15:18alostaleAssigned Toplatform => alostale
2015-10-22 15:27alostaleReview Assigned To => AugustoMauch
2015-10-22 15:28alostaleRegression level => Production - Confirmed Stable
2015-10-22 15:28alostaleRegression date => 2014-11-14
2015-10-22 15:28alostaleRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/84865a340443fbc6aa5c36d777c8c57df2f6525b [^]
2015-10-22 15:29hgbotCheckin
2015-10-22 15:29hgbotNote Added: 0081223
2015-10-22 15:29hgbotStatusscheduled => resolved
2015-10-22 15:29hgbotResolutionopen => fixed
2015-10-22 15:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2611ac34f778e07a9bbc92d6f699018a9f0ee8a6 [^]
2015-10-22 16:29alostaleNote Added: 0081226
2015-10-27 09:52AugustoMauchNote Added: 0081334
2015-10-27 09:52AugustoMauchStatusresolved => closed
2015-10-27 09:52AugustoMauchFixed in Version => 3.0PR16Q1
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082148

Notes
(0081200)
alostale   
2015-10-22 12:07   
(edited on: 2015-10-22 12:10)
When adding filter having product characteristics filtered this js error can be seen in console:

Uncaught TypeError: _3.condition is not a functionisc_DataSource_evaluateCriterion @ ISC_Combined.js:11189isc_c_Class_invokeSuper @
  ISC_Combined.js:245isc_c_Class_Super @ ISC_Combined.js:237isc.OBRestDataSource.addProperties.evaluateCriterion @ 89bf017c1690600804468d571109daf.js:197_31

This error was also present in previous releases (<=PR14Q4)

(0081212)
alostale   
2015-10-22 14:28   
The problem is in OBViewGrid.filterData method, when it tries to do Super.('filterData'...) in this situation invokes for some reason filterData method in VLayout (which doesn't exist) data is not actually refreshed and callback is never invoked.

This problem was present in <=PR14Q4, but OBViewGrid.filterData was invoked 3 times, the 1st one as it is now but the subsequent ones invoked filterData properly in OBGrid hidding this initial problem.
(0081223)
hgbot   
2015-10-22 15:29   
Repository: erp/devel/pi
Changeset: 2611ac34f778e07a9bbc92d6f699018a9f0ee8a6
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Oct 22 15:26:37 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2611ac34f778e07a9bbc92d6f699018a9f0ee8a6 [^]

fixed bug 31214: adding extra filter after product characteristics fails

  When product characteristics was filtered returning less than 100 records, and
  on top of that criteria a new one in another field was added, it was not possible
  to refresh the grid anymore.

  When this additional criteria was set, a javascript exception was thrown because
  adaptive filtering was tried to be evaluated for 'exists' search operator. This
  operator didn't implement condition funtion which was invoked causing the exception.
  This exception left the grid in an inconsistent estate which made not posible to
  refresh it.

  To fix it, 'condition' function has been implemented for 'exists' search operator,
  as this operator can't be evaluted in client side, we can ensure all fields in
  grid fulfill any criteria defined by it, so the implementation can return always
  true.

---
M modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
---
(0081226)
alostale   
2015-10-22 16:29   
Added test case in TestLink: https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9880 [^]
(0081334)
AugustoMauch   
2015-10-27 09:52   
Code reviewed and verified in pi@3a698bde90ad
(0082148)
hudsonbot   
2015-11-23 21:16   
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/7b56bebaaa88 [^]
Maturity status: Test