Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034470Openbravo ERPA. Platformpublic2016-11-11 10:562022-02-01 08:05
NaroaIriarte 
Triage Platform Base 
normalminoralways
acknowledgedopen 
5
 
 
Core
No
0034470: The manage variants filter is not working fine in some circumstances.
If there is a criteria which has two levels of deep and in the second level there are two criterias, filters cannot handle it and do not work properly.

Criterias of this kind:


criteria:{"fieldName":"id","operator":"equals","value":"A"}
criteria:{"operator":"and","_constructor":"AdvancedCriteria","criteria":[{"fieldName":"searchKey","operator":"iContains","value":"B"},{"fieldName":"name","operator":"iContains","value":"C"}]}

The problem is in the "ManageVariantsDS" manual datasource. The way of handling the criterias is not correct.
1- Log in the erp as F&B Admin.
2- Go to "Produc Characteristic" window and create a new product characteristic.
3- Mark the product characteristic as variant and add some values to it.
4- Go to "Product" window and create a new product.
5- Check the "Is Generic" chackbox.
6- Go to the "Characteristic" subtab and add the previously created charaacteristic.
7- Mark it as variant.
8- Run the "Generate Variants" process.
9- Click on the "Manage Variants" process.
10- Select the first record by clicking the checkbox.
11- Filter by another record, for example if the record clicked is "Test1" filter by another record, for example "Test2". Realize that the two records are shown. This is correct.
12- Go to another filter and filter by something which has no sense to try to not get any record. For example in the name filter write: asdas.
13- Realize that the two records filtered before are still shown. this is not correct, the correct result will be not having any record in the grid.
Change the "ManageVariantsDS.readCriteria" method and make it capable to handle these cases of criteria.
Code to be changed:

 if (criteria.has("_constructor")
          && "AdvancedCriteria".equals(criteria.getString("_constructor"))
          && criteria.has("criteria")) {
        JSONArray innerCriteriaArray = new JSONArray(criteria.getString("criteria"));
        criteria = innerCriteriaArray.getJSONObject(0);
      }
No tags attached.
related to defect 0034405pi closed NaroaIriarte 'Manage Variants' process returns no items to show when filtering 
Issue History
2016-11-11 10:56NaroaIriarteNew Issue
2016-11-11 10:56NaroaIriarteAssigned To => platform
2016-11-11 10:56NaroaIriarteModules => Core
2016-11-11 10:56NaroaIriarteTriggers an Emergency Pack => No
2016-11-11 10:56NaroaIriarteRelationship addedrelated to 0034405
2016-12-01 13:11alostaleStatusnew => acknowledged
2022-02-01 08:05alostaleAssigned Toplatform => Triage Platform Base

There are no notes attached to this issue.