Openbravo Issue Tracking System - Retail Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0034231 | Retail Modules | Web POS | public | 2016-10-18 12:10 | 2016-11-25 14:54 |
Reporter | aaroncalero | ||||
Assigned To | mario_castello | ||||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | RR17Q1 | |||
Merge Request Status | |||||
Review Assigned To | marvintm | ||||
OBNetwork customer | OBPS | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0034231: [SERQA 1966] PostProcess functions of dinamic SearchProductCharacteristicFilters are ignored after removing the filter | ||||
Description | It 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 Reproduce | Login 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 Solution | The 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) | ||||
Additional Information | |||||
Tags | SER-QA | ||||
Relationships | |||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=9928&type=bug | ||||
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 | OBNetwork customer | => Yes | ||
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 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|