Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034231
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2016-10-18 12:102016-11-25 14:54
ReporteraaroncaleroView Statuspublic 
Assigned Tomario_castello 
PriorityhighResolutionfixedFixed in VersionRR17Q1
StatusclosedFix in branchFixed in SCM revision0da6b627d7a0
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034231: [SERQA 1966] PostProcess functions of dinamic SearchProductCharacteristicFilters are ignored after removing the filter

DescriptionIt is possible to define custom filters for the search tab from external modules (e.g. Stock Criteria, Complementary Products, ...). These filters might implement a postProcess function to change values on the searched products, or to show more information on the results (e.g. Stock Criteria shows a "Stock: #" label).
These filters can be added statically when the application is loaded (Stock or Price criteria) or dynamically when a specific filter is needed (Services, Complementary Products).
After a dynamic filter is removed from the search tab, postProcess functions of all dynamic filters stop working.
Steps To ReproduceLogin in a retail modules instance (e.g. https://livebuilds.openbravo.com/retail_modules_pgsql_pi/web/org.openbravo.retail.posterminal/?terminal=CMS-1 [^])
Use the developer tools to execute the following code:
OBRECP_SearchProductCharacteristicFilter.extend({
  postProcess: function (products, callback, queryWasExecutedOnline) {
    products.forEach(function(item){
      item.set('standardPrice', 9999);
      item.set('listPrice', 9999);
    })
    callback(queryWasExecutedOnline)
  }
})

OB.UI.SearchServicesFilter.extend({
  postProcess: function (products, callback, queryWasExecutedOnline) {
    var me = this;
    products.forEach(function(item){
      me.addItemAttributes(item, "TEST: " + item.get('_identifier'));
    })
    callback(queryWasExecutedOnline)
  }
})

Create a new ticket and add the following products:
Thermal jacket
GPS Nano
Click on the complementary products button of the Thermal Jacket. Verify that the price of the complementary products is 9999.
Click on the related services button of the GPS Nano. Verify that there is a "TEST: <product name>" label on the search results.
Remove the services filter (click on the X of the yellow text on top of the search tab).
Repeat the steps and verify that the price of the complementary products isn't 9999 anymore, and that the "TEST: <product name>" label doesn't appear either.
Proposed SolutionThe postProcess functions are managed using an array named postProcessCustomFilters defined on the OB.UI.SearchProductCharacteristic kind.
The problem seems to be related with the fact that sometimes the prototype definition is used (OB.UI.SearchProductCharacteristic.prototype) to manage the postProcess functions, while in other occasions an OB.UI.SearchProductCharacteristic instance is used (e.g. when removing a filter).
One possible solution is to make the postProcessCustomFilters array static, and access it using the following notation: OB.UI.SearchProductCharacteristic.postProcessCustomFilters everywhere (attached patch with this option)
TagsSER-QA
Attached Filesdiff file icon Issue34231.diff [^] (2,227 bytes) 2016-10-18 12:11 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0091664)
hgbot (developer)
2016-11-18 21:30

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 0da6b627d7a0dc98b694263eb582a171647bc4f2
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Wed Nov 16 13:30:59 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0da6b627d7a0dc98b694263eb582a171647bc4f2 [^]

Fixed issue 34231: Created an static array postProcessCustomFilters to stored the filters

---
M web/org.openbravo.mobile.core/source/retail/component/ob-retail-searchproductcharacteristic.js
---
(0091665)
hgbot (developer)
2016-11-18 21:32

Repository: tools/automation/pi-mobile
Changeset: 0bcaf91b590411b2ada69d3adde14d0b569b0795
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Wed Nov 16 16:27:03 2016 -0600
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/0bcaf91b590411b2ada69d3adde14d0b569b0795 [^]

Verifies issue 34231: Added automated test I34231_VerifySearchProductCharacteristicFilters

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/I34231_VerifySearchProductCharacteristicFilters.java
---

- Issue History
Date Modified Username Field Change
2016-10-18 12:10 aaroncalero New Issue
2016-10-18 12:10 aaroncalero Assigned To => Retail
2016-10-18 12:10 aaroncalero Resolution time => 1477954800
2016-10-18 12:10 aaroncalero Triggers an Emergency Pack => No
2016-10-18 12:11 aaroncalero File Added: Issue34231.diff
2016-10-18 12:14 aaroncalero Tag Attached: SER-QA
2016-10-18 12:15 aaroncalero Summary PostProcess functions of dinamic SearchProductCharacteristicFilters are ignored after removing the filter => [SERQA 1966] PostProcess functions of dinamic SearchProductCharacteristicFilters are ignored after removing the filter
2016-10-28 09:12 marvintm Resolution time 1477954800 => 1478818800
2016-11-07 13:12 marvintm Resolution time 1478818800 => 1479423600
2016-11-16 16:31 mario_castello Assigned To Retail => mario_castello
2016-11-16 16:32 mario_castello Status new => acknowledged
2016-11-18 21:30 hgbot Checkin
2016-11-18 21:30 hgbot Note Added: 0091664
2016-11-18 21:30 hgbot Status acknowledged => resolved
2016-11-18 21:30 hgbot Resolution open => fixed
2016-11-18 21:30 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0da6b627d7a0dc98b694263eb582a171647bc4f2 [^]
2016-11-18 21:32 hgbot Checkin
2016-11-18 21:32 hgbot Note Added: 0091665
2016-11-25 14:54 marvintm Review Assigned To => marvintm
2016-11-25 14:54 marvintm Status resolved => closed
2016-11-25 14:54 marvintm Fixed in Version => RR17Q1


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker