Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043462Retail ModulesWeb POSpublic2020-03-09 17:092020-03-26 12:38
samuel_nicuesa 
rqueralta 
highmajoralways
closedfixed 
5
pi 
RR20Q2 
jorge-garcia
No
0043462: The query to find Bags and Gift Card products in Self Checkout is too slow.
The query to find Bags and Gift Card products in Self Checkout is too slow.
We need to have installed this module org.openbravo.retail.selfcheckout
The first time we load product bags and gift card products the query takes a lot of time to return the results.

We need to include 2 Index in M_PRODUCT table

This code loads the M_Product bags :

if (OB.MobileApp.model.hasPermission('OBPOS_remote.product', true)) {

    criteria.remoteFilters = [{
        columns: ['obscoIsBag'],
        operator: 'equals',
        value: 'Y'
    }];
}
OB.Dal.findUsingCache('bagSearch', OB.Model.Product, criteria, function(data) {
            if (data.length > 0) {
                data.forEach(function(product) {
                            button = me.$.bagsArea.createComponent({

And this code loads the Gift Card products


 OB.UI.GiftCardUtils.service(
      'org.openbravo.retail.giftcards.CancelGiftCard',
      {
        giftcard: card,
        _tryCentralFromStore: true,
        _executeInOneServer: true
      },
      function(result) {
        OB.UI.GiftCardUtils.findProductModel(result.product.id, function(
          transactionproduct
        ) {
Add these 2 indexes in M_PRODUCT TABLE

 <index name="M_PRODUCT_IDX" unique="false">
 <index-column name="M_PRODUCT_ID"/>
 </index>

 <index name="EM_OBSCO_ISBAG_IDX" unique="false">
 <index-column name="EM_OBSCO_ISBAG"/>
 </index>
No tags attached.
Issue History
2020-03-09 17:09samuel_nicuesaNew Issue
2020-03-09 17:09samuel_nicuesaAssigned To => Retail
2020-03-09 17:09samuel_nicuesaResolution time => 1585519200
2020-03-09 17:09samuel_nicuesaTriggers an Emergency Pack => No
2020-03-18 00:13rqueraltaAssigned ToRetail => rqueralta
2020-03-18 00:13rqueraltaStatusnew => scheduled
2020-03-25 15:48hgbotCheckin
2020-03-25 15:48hgbotNote Added: 0118813
2020-03-25 15:48hgbotStatusscheduled => resolved
2020-03-25 15:48hgbotResolutionopen => fixed
2020-03-25 15:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.selfcheckout/rev/65aaf8b0379299123090ba158da2fa7f53ad3aa7 [^]
2020-03-26 08:53jorge-garciaReview Assigned To => jorge-garcia
2020-03-26 12:38jorge-garciaNote Added: 0118832
2020-03-26 12:38jorge-garciaStatusresolved => closed
2020-03-26 12:38jorge-garciaFixed in Version => RR20Q2

Notes
(0118813)
hgbot   
2020-03-25 15:48   
Repository: erp/pmods/org.openbravo.retail.selfcheckout
Changeset: 65aaf8b0379299123090ba158da2fa7f53ad3aa7
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Thu Mar 19 10:04:20 2020 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.selfcheckout/rev/65aaf8b0379299123090ba158da2fa7f53ad3aa7 [^]

Fixed BUG-43462: The query to find Bags and Gift Card products in Self Checkout
is too slow.

- Added a new index in m_product table

---
M src-db/database/model/modifiedTables/M_PRODUCT.xml
---
(0118832)
jorge-garcia   
2020-03-26 12:38   
Finally, the problem detected in giftcards was caused by a custom module implementation of Gift Cards in a client.

The code only affects to Bags products and it was tested and reviewed.