details:   /erp/devel/pi/rev/5ee0d40e2f3a
changeset: 13082:5ee0d40e2f3a
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Sat Jul 02 17:19:58 2011 +0200
summary:   Fixes issue 17869: Save and close does not work
Only occurs if the form was not validated again, solved by validating before 
auto-saving

details:   /erp/devel/pi/rev/765a49285b92
changeset: 13083:765a49285b92
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Sat Jul 02 17:20:40 2011 +0200
summary:   Added space line

details:   /erp/devel/pi/rev/c5d64918e6c7
changeset: 13084:c5d64918e6c7
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Sat Jul 02 17:21:20 2011 +0200
summary:   Fixes issue with autosave being fired when opening form
Solved by revalidating form when firing autosave

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
       |  1 +
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
            |  7 ++++---
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
   |  2 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
 |  2 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
      |  1 -
 5 files changed, 7 insertions(+), 6 deletions(-)

diffs (70 lines):

diff -r f16df639d37d -r c5d64918e6c7 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Sat Jul 02 16:43:45 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Sat Jul 02 17:21:20 2011 +0200
@@ -1178,6 +1178,7 @@
         if(savingNewRecord){
           this.attachmentsSection.fillAttachments(null);
         }
+        
       } else if (status === isc.RPCResponse.STATUS_VALIDATION_ERROR && 
resp.errors) {
         form.handleFieldErrors(resp.errors);
         view.standardWindow.autoSaveDone(view, false);
diff -r f16df639d37d -r c5d64918e6c7 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
  Sat Jul 02 16:43:45 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
  Sat Jul 02 17:21:20 2011 +0200
@@ -318,7 +318,7 @@
     this.Super('initWidget', arguments);
   },
   
-  clearFilter: function(keepFilterClause){
+  clearFilter: function(keepFilterClause, noPerformAction){
     var i = 0, fld;
     if (!keepFilterClause) {
       delete this.filterClause;
@@ -332,8 +332,9 @@
         fld.setSingleDateValue(null);
       }
     }
-
-    this.filterEditor.performAction();
+    if (!noPerformAction) {
+      this.filterEditor.performAction();
+    }
   },
   
   showSummaryRow: function(){
diff -r f16df639d37d -r c5d64918e6c7 
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
 Sat Jul 02 16:43:45 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Sat Jul 02 17:21:20 2011 +0200
@@ -735,7 +735,7 @@
     this.viewGrid.deselectAllRecords(false, true);
     
     if (this.viewGrid.filterEditor) {
-      this.viewGrid.clearFilter();
+      this.viewGrid.clearFilter(false, true);
     }
     if (this.viewGrid.data && this.viewGrid.data.setCriteria) {
       this.viewGrid.data.setCriteria(null);
diff -r f16df639d37d -r c5d64918e6c7 
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
       Sat Jul 02 16:43:45 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Sat Jul 02 17:21:20 2011 +0200
@@ -134,7 +134,7 @@
 
   doActionAfterAutoSave: function(action, forceDialogOnFailure, 
ignoreAutoSaveEnabled) {
     // if not dirty or we know that the object has errors
-    if (!this.getDirtyEditForm() || (this.getDirtyEditForm() && 
this.getDirtyEditForm().hasErrors())) {
+    if (!this.getDirtyEditForm() || (this.getDirtyEditForm() && 
!this.getDirtyEditForm().validateForm())) {
 
       // clean up before calling the action, as the action
       // can set dirty form again
diff -r f16df639d37d -r c5d64918e6c7 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Sat Jul 02 16:43:45 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Sat Jul 02 17:21:20 2011 +0200
@@ -71,7 +71,6 @@
       if(!this.view.viewForm.validateForm()) {
         return;
       }
-      this.view.saveRow();
       this.view.switchFormGridVisibility();
       this.view.messageBar.hide();
     },

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to