Openbravo Issue Tracking System - Retail Modules
View Issue Details
0046244Retail ModulesWeb POSpublic2021-04-10 08:102021-04-12 09:57
jetxarri 
Retail 
normalminoralways
newopen 
5
RR21Q1.1 
 
No
0046244: Remove legacy code that it is not working and it is making the login slower
File "web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js"

We can find the following peace of code
if (!OB.MobileApp.model.hasPermission('OBPOS_remote.product', true)) {
      loadProductCharacteristics();
    } else {
      var criteria = {};
      OB.Dal.find(
        OB.Model.Characteristic,
        criteria,
        successCallbackProductCh,
        errorCallback
      );
    }

If we go deeper it is going to load all the product characteristics value

let characteritics = await OB.App.MasterdataModels.ProductCharacteristicValue.find(
    criteriaCharacteristics
);

And finally include into array

for (let i = 0; i < characteritics.length; i++) {
          transformedCharacteristics.push(
            OB.Dal.transform(
              OB.Model.ProductCharacteristicValue,
              characteritics[i]
            )
          );
        }

And finally include in the component attribute

me.productsCh.reset(dataProductCh.models);

But as it is an array, dataProductCh.models is always undefined and because it is not a backbone collection. This is an old code that maybe had sense in the past but no longer.

P.S.: me.productsCh is set in another peace of code with product characteristic and not "product characteristics value" what it has more sense
Do the login and verify that the above code is executed.
Attached patch
NOR
related to feature request 0046182 new Retail Refactor/improve of Promo Engine and full / incremental refresh to remove the ProductCharacteristicsValue model 
diff patch.diff (2,797) 2021-04-10 08:10
https://issues.openbravo.com/file_download.php?file_id=15520&type=bug
Issue History
2021-04-10 08:10jetxarriNew Issue
2021-04-10 08:10jetxarriAssigned To => Retail
2021-04-10 08:10jetxarriFile Added: patch.diff
2021-04-10 08:10jetxarriTriggers an Emergency Pack => No
2021-04-12 09:45jetxarriTag Attached: NOR
2021-04-12 09:57rafarodaRelationship addedrelated to 0046182

There are no notes attached to this issue.