Related with issue 25811: Refresh children after executing standard process
authorAugusto Mauch <augusto.mauch@openbravo.com>
Fri, 14 Nov 2014 13:48:56 +0100
changeset 25278 210eae6f638e
parent 25277 583b44b2b1c6
child 25279 5c8dd0e358f2
Related with issue 25811: Refresh children after executing standard process

This was already being done after executing the legacy processes (handled in OBToolbarActionButton.closeProcessPopup), but it had not been done for the standard processes (handled in OBParameterWindowView.
handleResponse).
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js	Fri Nov 14 13:28:58 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js	Fri Nov 14 13:48:56 2014 +0100
@@ -319,7 +319,7 @@
   handleResponse: function (refreshParent, message, responseActions, retryExecution, data) {
     var window = this.parentWindow,
         tab = OB.MainView.TabSet.getTab(this.viewTabId),
-        i;
+        i, afterRefreshCallback, me = this;
 
     // change title to done
     if (tab) {
@@ -385,13 +385,18 @@
 
     if (this.popup && !retryExecution) {
       this.buttonOwnerView.setAsActiveView();
-
+      afterRefreshCallback = function () {
+        if (me.buttonOwnerView && isc.isA.Function(me.buttonOwnerView.refreshParentRecord) && isc.isA.Function(me.buttonOwnerView.refreshChildViews)) {
+          me.buttonOwnerView.refreshParentRecord();
+          me.buttonOwnerView.refreshChildViews();
+        }
+      };
       if (refreshParent) {
         if (this.callerField && this.callerField.view && typeof this.callerField.view.onRefreshFunction === 'function') {
           // In this case we are inside a process called from another process, so we want to refresh the caller process instead of the main window.
           this.callerField.view.onRefreshFunction(this.callerField.view);
         } else {
-          window.refresh();
+          this.buttonOwnerView.refreshCurrentRecord(afterRefreshCallback);
         }
       }