details:   https://code.openbravo.com/erp/devel/pi/rev/f218a3d70f90
changeset: 18185:f218a3d70f90
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Wed Oct 10 11:32:37 2012 +0200
summary:   Fixes issue 20328: Sometimes it is possible to trigger an incomplete 
autosave

The previous approach used to fix this issue not only did not work in the grid 
view, but it was not completely correct in the form view. If we allowed to move 
to the child tab before saving the parent tab, we would be enabling to create a 
child record, which would fail if the parent record has not been saved yet.

The new approach is to not allow to change the active tab at all until the 
currently focused tab can be saved (that is, until it has received the FIC 
response).

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
   |  4 ++++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
 |  5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r bb473254ab6e -r f218a3d70f90 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Wed Oct 10 11:12:58 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Wed Oct 10 11:32:37 2012 +0200
@@ -743,6 +743,10 @@
   },
 
   setAsActiveView: function (autoSaveDone) {
+    var activeView = this.standardWindow.activeView;
+    if (activeView && activeView !== this && ((activeView.isShowingForm && 
activeView.viewForm.inFicCall) || (!activeView.isShowingForm && 
activeView.viewGrid.getEditForm() && 
activeView.viewGrid.getEditForm().inFicCall))) {
+      return;
+    }
     if (!autoSaveDone && this.standardWindow.activeView && 
this.standardWindow.activeView !== this) {
       var actionObject = {
         target: this,
diff -r bb473254ab6e -r f218a3d70f90 
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
       Wed Oct 10 11:12:58 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Wed Oct 10 11:32:37 2012 +0200
@@ -676,10 +676,7 @@
       }
 
       // if not dirty or we know that the object has errors
-      if (!me.getDirtyEditForm() || (me.getDirtyEditForm() && 
me.getDirtyEditForm().inFicCall) || (me.getDirtyEditForm() && 
!me.getDirtyEditForm().validateForm())) {
-        if (me.getDirtyEditForm() && me.getDirtyEditForm().inFicCall) {
-          me.getDirtyEditForm().callSaveAfterFICReturn = true;
-        }
+      if (!me.getDirtyEditForm() || (me.getDirtyEditForm() && 
!me.getDirtyEditForm().validateForm())) {
         // clean up before calling the action, as the action
         // can set dirty form again
         me.cleanUpAutoSaveProperties();

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to