Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034531Retail ModulesFilter by stock in product searchpublic2016-11-15 13:202016-12-16 13:12
nataliag 
jorge-garcia 
normalmajoralways
closedfixed 
5
 
 
marvintm
No
0034531: Filer by stock in product search only allows to search by name of a product if you use the first word of the product name.
If you are using the stock filter in the product search of web Pos and you search a product by its name,the search only works if you search the product by the first word of this name. If you use the second, third or another word different from the first one,the result is not the expected. Example:
If the product is “Alpine Ski Boots” and you search by “Alpine” one of the results will be these boots. But if you do the search using “Ski”, any of the results will be those “Alpine Ski Boots”.
1- Go to web POS and select SEARCH option in the menu.
2- Select the Stock Filter and put it like More than 0.
3- Introduce in the search field “Alpine ski boot”
4- One product is shown. It is OK.
5- Now introduce in the search field “ski boot”. Any result is shown.
No tags attached.
related to defect 0034966 closed jorge-garcia Filter by stock in product search does not allow to filter by other filter categories using part of the name of the product. 
patch 34531fix.patch (1,131) 2016-11-23 11:09
https://issues.openbravo.com/file_download.php?file_id=10094&type=bug
patch 34531test.patch (4,232) 2016-11-23 11:09
https://issues.openbravo.com/file_download.php?file_id=10095&type=bug
Issue History
2016-11-15 13:20nataliagNew Issue
2016-11-15 13:20nataliagAssigned To => Retail
2016-11-15 13:20nataliagResolution time => 1480978800
2016-11-15 13:20nataliagTriggers an Emergency Pack => No
2016-11-16 09:45eugeniIssue Monitored: eugeni
2016-11-21 13:02shivum039Assigned ToRetail => shivum039
2016-11-21 13:02shivum039Statusnew => scheduled
2016-11-23 11:09shivum039File Added: 34531fix.patch
2016-11-23 11:09shivum039File Added: 34531test.patch
2016-11-30 13:01hgbotCheckin
2016-11-30 13:01hgbotNote Added: 0091933
2016-11-30 13:02shivum039Note Edited: 0091933bug_revision_view_page.php?bugnote_id=0091933#r13918
2016-11-30 13:02shivum039Statusscheduled => resolved
2016-11-30 13:02shivum039Resolutionopen => fixed
2016-11-30 13:05hgbotCheckin
2016-11-30 13:05hgbotNote Added: 0091934
2016-12-12 09:13marvintmNote Added: 0092269
2016-12-12 09:13marvintmStatusresolved => new
2016-12-12 09:13marvintmResolutionfixed => open
2016-12-12 09:13marvintmAssigned Toshivum039 => Retail
2016-12-12 10:22marvintmNote Added: 0092278
2016-12-12 12:57jorge-garciaAssigned ToRetail => jorge-garcia
2016-12-13 16:24hgbotCheckin
2016-12-13 16:24hgbotNote Added: 0092320
2016-12-13 16:24hgbotCheckin
2016-12-13 16:24hgbotNote Added: 0092321
2016-12-13 16:24hgbotStatusnew => resolved
2016-12-13 16:24hgbotResolutionopen => fixed
2016-12-13 16:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c0f13221491dc0df03e963f3f99a08b3a05644d3 [^]
2016-12-16 13:12marvintmReview Assigned To => marvintm
2016-12-16 13:12marvintmStatusresolved => closed
2017-01-16 13:29marvintmRelationship addedrelated to 0034966

Notes
(0091933)
hgbot   
2016-11-30 13:01   
(edited on: 2016-11-30 13:02)
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 685706c870833328e3c93965beb6547c1461c8cc
Author: Shivanand Madiwalar <shivanand.madiwalar <at> promantia.com>
Date: Wed Nov 30 14:11:13 2016 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/685706c870833328e3c93965beb6547c1461c8cc [^]

Fixes Issue 34531 : Logic Added For the Product Filter when its COmbined with "Stock" filter and having any pattern which belongs to the same product over not only "STARTS WITH" Operator .

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

(0091934)
hgbot   
2016-11-30 13:05   
Repository: tools/automation/pi-mobile
Changeset: 06ea0bd36e3e2227becbf01037815793a2c51518
Author: Shivanand Madiwalar <shivanand.madiwalar <at> promantia.com>
Date: Mon Nov 28 18:46:38 2016 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/06ea0bd36e3e2227becbf01037815793a2c51518 [^]

Verifies Issue 34531 : Automated which verifies Logic Added For the Product Filter when its COmbined with "Stock" filter and having any pattern which belongs to the same product over not only "STARTS WITH" Operator .

---
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/stockcriteria/I34531_FilterWithCombinationAndPatternContain.java
---
(0092269)
marvintm   
2016-12-12 09:13   
Fix is not correct, the operator shouldn't be set. Attached proper fix candidate.
(0092278)
marvintm   
2016-12-12 10:22   
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
--- 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
@@ -1310,7 +1310,11 @@
             characteristicfilter.columns = [];
             characteristicfilter.operator = OB.Dal.FILTER;
             characteristicfilter.value = me.productCharacteristicFilterQualifier;
- productText = (OB.MobileApp.model.hasPermission('OBPOS_remote.product' + OB.Dal.USESCONTAINS, true) ? '%' : '') + productFilterText.getValue() + '%';
+ if (OB.MobileApp.model.hasPermission('OBPOS_remote.product', true)) {
+ productText = ( && OB.MobileApp.model.hasPermission('OBPOS_remote.product' + OB.Dal.USESCONTAINS, true) ? '%' : '') + productFilterText.getValue() + '%';
+ } else {
+ productText = '%' + productFilterText.getValue() + '%';
+ }
             characteristicfilter.params = [productText, productcategory.value, characteristicParams];
             remoteCriteria.push(characteristicfilter);
           }
(0092320)
hgbot   
2016-12-13 16:24   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 6a86df93c5adcc5bdec5d584d8d61eae213630b1
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Dec 13 12:25:41 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6a86df93c5adcc5bdec5d584d8d61eae213630b1 [^]

Related to issue 34531: Filer by stock in product search only allows to search
by name of a product if you use the first word of the product name.

Backout changeset 685706c870833328e3c93965beb6547c1461c8cc.

---
M web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js
---
(0092321)
hgbot   
2016-12-13 16:24   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c0f13221491dc0df03e963f3f99a08b3a05644d3
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Dec 13 12:48:28 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c0f13221491dc0df03e963f3f99a08b3a05644d3 [^]

Fixed issue 34531: Filter by stock in product search only allows to search
by name of a product if you use the first word of the product name.

In general, the search of products without remote is done using the contains
condition because we can assume the quantity of products will be small. This is
not done in case we use high volumes, where we search products using the
startswith condition.

The problem was that in stock criteria module, the WebPOS forces to search those
products in the server. In this case, the condition of startswith is
implemented and the search could be different than before.

The problem now is fixed.

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