Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035945Retail ModulesWeb POSpublic2017-05-08 17:252017-05-25 18:56
aaroncalero 
jorge-garcia 
highmajoralways
closedfixed 
5
 
RR17Q3 
marvintm
No
0035945: Extra Product requests done using Multipricelist functionality
When the Multipricelist functionality is configured, each customer can have its own Price List in webpos.
Since different price lists can contain different prices for the same product, every time the current price list changes, a Product search is fired, applying the same filters than the current search.
However this search is fired even if the webpos is not currently showing a product search result (i.e. on the Browse or Search tabs), and in these cases an empty search (without any filter) is fired; when the Remote preference for Products is enabled, these search requests are done against the server.
Login in backend
Go to the preference window
Configure the 'Web POS Enable Multi Price List' preference with a value of 'Y'.
Configure the 'Enable Remote for Product' preference with a value of 'Y'.

Go to the webpos and open the Network tab on the developer console.
Login in the application.
During the end of the login process, a request to org.openbravo.retail.posterminal.master.Product will be done
Both the Browse tab and the Search tab have an event handler for the onChangePricelist event. One possible solution is to verify the current tab (OB.MobileApp.model.get('lastPaneShown')) before executing the action inside the handler.
No tags attached.
related to defect 0035485 closed gorka_gil Doing login in a multiprice list terminal with remote configured, do a product query without filters that is not needed 
Issue History
2017-05-08 17:25aaroncaleroNew Issue
2017-05-08 17:25aaroncaleroAssigned To => Retail
2017-05-08 17:25aaroncaleroResolution time => 1495404000
2017-05-08 17:25aaroncaleroTriggers an Emergency Pack => No
2017-05-08 17:26aaroncaleroRelationship addedrelated to 0035383
2017-05-09 09:54jorge-garciaStatusnew => scheduled
2017-05-09 09:54jorge-garciaAssigned ToRetail => jorge-garcia
2017-05-10 08:39hgbotCheckin
2017-05-10 08:39hgbotNote Added: 0096499
2017-05-10 08:39hgbotStatusscheduled => resolved
2017-05-10 08:39hgbotResolutionopen => fixed
2017-05-10 08:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/4af36cd4c3947b8b30db4f9597d93e737d37073f [^]
2017-05-18 09:17marvintmNote Added: 0096656
2017-05-18 09:17marvintmStatusresolved => new
2017-05-18 09:17marvintmResolutionfixed => open
2017-05-19 09:31jorge-garciaStatusnew => scheduled
2017-05-24 08:46hgbotCheckin
2017-05-24 08:46hgbotNote Added: 0096739
2017-05-24 08:46jorge-garciaStatusscheduled => resolved
2017-05-24 08:46jorge-garciaResolutionopen => fixed
2017-05-25 18:56marvintmReview Assigned To => marvintm
2017-05-25 18:56marvintmStatusresolved => closed
2017-05-25 18:56marvintmFixed in Version => RR17Q3
2017-06-21 17:37SandrahuguetRelationship addedrelated to 0035485
2017-06-21 17:37SandrahuguetRelationship deletedrelated to 0035383

Notes
(0096499)
hgbot   
2017-05-10 08:39   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 4af36cd4c3947b8b30db4f9597d93e737d37073f
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue May 09 12:00:00 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/4af36cd4c3947b8b30db4f9597d93e737d37073f [^]

Fixed issue 35945: Extra Product requests done using Multipricelist
functionality

The solution is to avoid product search on price list change. Also, the list
of products should be reset in this case.

---
M web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js
---
(0096656)
marvintm   
2017-05-18 09:17   
Two changes should be made:
- Instead of checking the permissions array directly, the hasPermissions API should be used.
- The code should be simplified. Instead of doing a big if, and then copying the call except for one property, a single call should be done with the property defined as the preference value:

 this.doSearchAction({
        productCat: this.$.searchProductCharacteristicHeader.$.productcategory.getValue() || '__all__',
        productName: this.$.searchProductCharacteristicHeader.$.productFilterText.getValue() || '',
        filter: this.model.get('filter'),
        skipProduct: OB.MobileApp.model.hasPermission("OBPOS_remote.product", true),
        skipProductCharacteristic: false
      });
(0096739)
hgbot   
2017-05-24 08:46   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 62af222b1afe86ac5d790be9d4fd0125982101bb
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Fri May 19 09:48:04 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/62af222b1afe86ac5d790be9d4fd0125982101bb [^]

Related issue 35945: Extra Product requests done using Multipricelist
functionality

* Used API to check permissions.

* The code has been simplified.

---
M web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js
---