Related with issue 28466: Autosave was executed when creating a new record.
authorNaroa Iriarte <naroa.iriarte@openbravo.com>
Mon, 29 Dec 2014 11:13:30 +0100
changeset 25713 b878d4b1ee9a
parent 25712 e96a15e0c289
child 25714 8965d2c4301b
Related with issue 28466: Autosave was executed when creating a new record.

The function "saveEditorReply" of the "ob-view-form.js" class has been changed in order to not
having duplicate code.
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	Fri Jan 02 13:01:06 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Dec 29 11:13:30 2014 +0100
@@ -1605,9 +1605,8 @@
 
   // always let the saveRow callback handle the error
   saveEditorReply: function (response, data, request) {
-    var form, isNewRecord;
-    form = request.editor.view.isShowingForm ? request.editor.view.viewForm : request.editor.view.viewGrid.getEditForm();
-    isNewRecord = form === null ? false : form.isNew;
+    var isNewRecord;
+    isNewRecord = request.editor.view.isEditingNewRecord();
     if (request.editor && request.editor.view && isNewRecord) {
       delete request.editor.view._savingNewRecord;
     }