From b724ad8ac3af63673f223ed5f072469ec5e04132 Mon Sep 17 00:00:00 2001
From: Javier Etxarri <javier.echarri@openbravo.com>
Date: Sat, 10 Apr 2021 08:02:41 +0200
Subject: [PATCH] Related to issue 3074; Remove legacy code to make login
 faster Fixing issue 3111: removing ProductCharacteristicsValue model. We
 realize that the ppiece of code that we are removing was useless and it was
 not working

---
 .../ob-retail-searchproductcharacteristic.js  | 51 -------------------
 1 file changed, 51 deletions(-)

diff --git a/web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js b/web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js
index d66c3702..9d221c93 100644
--- a/web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js
+++ b/web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js
@@ -1065,45 +1065,6 @@ enyo.kind({
       this.$.characteristicsFilterContainer.addClass('u-hideFromUI ');
     }
 
-    async function loadProductCharacteristics() {
-      let criteriaCharacteristics = new OB.App.Class.Criteria()
-        .orderBy('_identifier', 'asc')
-        .criterion('obposFilteronwebpos', true)
-        .build();
-      try {
-        let characteritics = await OB.App.MasterdataModels.ProductCharacteristicValue.find(
-          criteriaCharacteristics
-        );
-        let transformedCharacteristics = [];
-        for (let i = 0; i < characteritics.length; i++) {
-          transformedCharacteristics.push(
-            OB.Dal.transform(
-              OB.Model.ProductCharacteristicValue,
-              characteritics[i]
-            )
-          );
-        }
-        successCallbackProductCh(transformedCharacteristics);
-      } catch (error) {
-        errorCallback(error);
-      }
-    }
-
-    function errorCallback(tx, error) {
-      OB.UTIL.showError(error);
-    }
-
-    function successCallbackProductCh(dataProductCh) {
-      if (me.destroyed) {
-        return;
-      }
-      if (dataProductCh && dataProductCh.length > 0) {
-        me.productsCh.reset(dataProductCh.models);
-      } else {
-        me.productsCh.reset();
-      }
-    }
-
     this.products.on(
       'click',
       function(model) {
@@ -1158,18 +1119,6 @@ enyo.kind({
       },
       this
     );
-
-    if (!OB.MobileApp.model.hasPermission('OBPOS_remote.product', true)) {
-      loadProductCharacteristics();
-    } else {
-      var criteria = {};
-      OB.Dal.find(
-        OB.Model.Characteristic,
-        criteria,
-        successCallbackProductCh,
-        errorCallback
-      );
-    }
   },
   changePricelist: function(inSender, inEvent) {
     this.currentPriceList = inEvent.priceList;
-- 
2.27.0

