Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041043Retail ModulesWeb POSpublic2019-06-06 16:532019-06-25 13:06
guillermogil 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR19Q3 
guilleaer
No
0041043: Retry number is not updated
Retry number is not updated if there is a preference defined and then removed unless you clear the cache or you define it to 0.
- Login on livebuilds (without retries preference created)
- Execute the following on the console: OB.UTIL.localStorage.getItem('maxNumOfRequestRetries')
- Value will be 0
- Execute the following on the console: OB.UTIL.localStorage.setItem('maxNumOfRequestRetries', 2)
- Refresh the POS
- Execute the following on the console: OB.UTIL.localStorage.getItem('maxNumOfRequestRetries')
- Value will be 2
- Create the preference with value 0 on the backoffice
- Reload the POS
- Execute the following on the console: OB.UTIL.localStorage.getItem('maxNumOfRequestRetries')
- Value will be 0
This code should be updated:

      function getPreference(preference, minValue, defaultValue) {
        try {
          var val = OB.MobileApp.model.get('permissions')[preference];
          if (!val || !_.isNumber(parseInt(val, 10)) || parseInt(val, 10) < minValue) {
            return defaultValue;
          }
          return parseInt(val, 10);
        } catch (e) {
          return defaultValue;
        }
      }

!val condition is not working as expected. If there is no preference it should put 0
No tags attached.
Issue History
2019-06-06 16:53guillermogilNew Issue
2019-06-06 16:53guillermogilAssigned To => Retail
2019-06-06 16:53guillermogilResolution time => 1561154400
2019-06-06 16:53guillermogilTriggers an Emergency Pack => No
2019-06-11 14:22ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-06-11 14:22ranjith_qualiantech_comStatusnew => scheduled
2019-06-12 08:28hgbotCheckin
2019-06-12 08:28hgbotNote Added: 0112589
2019-06-12 08:28hgbotStatusscheduled => resolved
2019-06-12 08:28hgbotResolutionopen => fixed
2019-06-12 08:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/03a80a7ff428c6f8b1a56ee62027c80347c05d88 [^]
2019-06-25 13:06guilleaerReview Assigned To => guilleaer
2019-06-25 13:06guilleaerStatusresolved => closed
2019-06-25 13:06guilleaerFixed in Version => RR19Q3

Notes
(0112589)
hgbot   
2019-06-12 08:28   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 03a80a7ff428c6f8b1a56ee62027c80347c05d88
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Jun 12 11:58:31 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/03a80a7ff428c6f8b1a56ee62027c80347c05d88 [^]

Fixed issue 41043 : Request Preference should use defaultValue instead of localStorage value when creating it

* If Preference is enabled, Preference value will be updated to localStorage.
  If Preference is removed, then defaultValue should be updated to localStorage instead of updating localStorage again to localStorage

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
---