Related with issue 25811: Dont refresh the whole grid after executing process
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 11 Nov 2014 10:51:04 +0100
changeset 25268 6ea2e99171af
parent 25267 31d3d17e8d78
child 25269 c51dce7e9fd3
Related with issue 25811: Dont refresh the whole grid after executing process

Instead of refreshing the whole grid after executing a process, only the selected record will be refreshed. This is done for performance reasons.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Tue Nov 11 10:49:41 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Tue Nov 11 10:51:04 2014 +0100
@@ -150,8 +150,8 @@
         currentView = this.view,
         afterRefresh, isAfterRefreshAlreadyExecuted, parsePathPart, parts;
 
-    afterRefresh = function (doRefresh) {
-      var undef, refresh = (doRefresh === undef || doRefresh),
+    afterRefresh = function () {
+      var undef,
           autosaveDone = false,
           currentRecordId, recordsAfterRefresh;
 
@@ -178,18 +178,6 @@
         // let's set half for each in order to see the message
         contextView.setHalfSplit();
       }
-      // Refresh in order to show possible new records
-      if (refresh) {
-        // The selected record should be shown after the refresh, even
-        // if the filter would exclude it
-        // See issue https://issues.openbravo.com/view.php?id=20722
-        if (currentView.parentTabId) {
-          recordsAfterRefresh = currentView.newRecordsAfterRefresh[currentView.parentTabId];
-        } else {
-          recordsAfterRefresh = currentView.newRecordsAfterRefresh;
-        }
-        currentView.refresh(null, autosaveDone, recordsAfterRefresh);
-      }
       if (contextView.viewGrid.isGrouped) {
         // if the grid is grouped refresh the grid to show the records properly
         contextView.viewGrid.refreshGrid();
@@ -212,7 +200,7 @@
       }
     } else {
       // If the button is not autosave, do not refresh but get message.
-      afterRefresh(false);
+      afterRefresh();
     }
 
     OB.ActionButton.executingProcess = null;