[client-event-handlers] Not execute pre-save actions when save is not accepted
authorCarlos Aristu <carlos.aristu@openbravo.com>
Thu, 16 Jun 2016 10:14:21 +0200
changeset 29795 d7b00f5a135c
parent 29794 93a252909ec5
child 29796 f7fd27fb10b9
[client-event-handlers] Not execute pre-save actions when save is not accepted
Pre-Save actions should not be executed if the answer to the confirmation prompt is negative.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Thu Jun 16 09:59:01 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Thu Jun 16 10:14:21 2016 +0200
@@ -779,9 +779,13 @@
         preSaveCallback, saveCallback;
 
     preSaveCallback = function (ok) {
-      me.activeView.executePreSaveActions(function () {
-        saveCallback(ok);
-      });
+      if (ok) {
+        me.activeView.executePreSaveActions(function () {
+          saveCallback(true);
+        });
+        return;
+      }
+      saveCallback(false);
     };
 
     saveCallback = function (ok) {