Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036275Retail ModulesWeb POSpublic2017-06-19 16:592017-06-27 09:12
jonibc 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
RR17Q3 
marvintm
No
0036275: [SERQA 3022] Error callback not done in runSyncProcess (PostCustomerSave hook)
Error callback is not sent to RunSyncProcess function, so if an error is raised, while saving a customer, can block 'Save' and 'Cancel' buttons until a refresh is done in the browser.

          OB.UTIL.HookManager.executeHooks('OBPOS_PostCustomerSave', {
            customer: customer,
            bpToSave: bpToSave
          }, function (args) {
            OB.Dal.save(bpToSave, function () {
              // update each order also so that new name is shown and the bp
              // in the order is the same as what got saved
....
              var successCallback, errorCallback, List;
              successCallback = function () {
                if (callback) {
                  callback();
                }
                OB.UTIL.showSuccess(OB.I18N.getLabel('OBPOS_customerSaved', [customer.get('_identifier')]));
              };
              OB.MobileApp.model.runSyncProcess(successCallback);
            }, function () {
              //error saving BP changes with changes in changedbusinesspartners
              OB.UTIL.showError(OB.I18N.getLabel('OBPOS_errorSavingCustomerChanges', [customer.get('_identifier')]));
            });
N/A
Add callback to runSyncProcess function as follows:

              OB.MobileApp.model.runSyncProcess(successCallback, callback);

Also to avoid the error added in Notes, the proposal is:

              Send a boolean parameter through callback function, that allows to skip the code if an error is raised.
No tags attached.
related to defect 0035981pi closed jorge-garcia [SERQA 2847] Buttons for customer and locations are not blocked in synchronized mode. 
Issue History
2017-06-19 16:59jonibcNew Issue
2017-06-19 16:59jonibcAssigned To => Retail
2017-06-19 16:59jonibcResolution time => 1499119200
2017-06-19 16:59jonibcTriggers an Emergency Pack => No
2017-06-19 17:15jonibcRelationship addedrelated to 0035981
2017-06-20 11:46ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2017-06-20 11:46ranjith_qualiantech_comStatusnew => scheduled
2017-06-20 13:19jonibcNote Added: 0097509
2017-06-20 13:19jonibcProposed Solution updated
2017-06-26 14:23hgbotCheckin
2017-06-26 14:23hgbotNote Added: 0097655
2017-06-26 14:23hgbotStatusscheduled => resolved
2017-06-26 14:23hgbotResolutionopen => fixed
2017-06-26 14:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/62e2b80668eb5009711ab99c962b5bfe0acec569 [^]
2017-06-27 09:12marvintmReview Assigned To => marvintm
2017-06-27 09:12marvintmStatusresolved => closed
2017-06-27 09:12marvintmFixed in Version => RR17Q3

Notes
(0097509)
jonibc   
2017-06-20 13:19   
If the runSyncProcess call fails, the following code should not be executed to avoid open 'View Details' window:

    if (!inEvent.silent) {
            me.bubble('onCancelClose', {
              customer: customerEdited
            });
    }

A solution could be to send a boolean parameter through callback function, that allows to skip the code if an error is raised.
(0097655)
hgbot   
2017-06-26 14:23   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 62e2b80668eb5009711ab99c962b5bfe0acec569
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jun 26 17:52:39 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/62e2b80668eb5009711ab99c962b5bfe0acec569 [^]

Fixed issue 36275 : Callback of SaveCustomer should be called from OBPOS_PostCustomerSave hook and runSyncProcess

* If Customer Save or runSyncProcess failed, then callback of SaveCustomer will return as false

---
M web/org.openbravo.retail.posterminal/js/data/datacustomersave.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js
---