fixes issue
31070: Deleting pop-up is never closed under some circumnstances
The problem was that when removing a record that is being editing, the updateTabTitle function was crashing when trying to access to this.viewGrid.getEditForm().isNew because this.viewGrid.getEditForm() is undefined at that point.
Apart from this, the isEditingGrid is not restored to false when removing a record which is being edited. This caused new errors after removing, because the view is not marked as in non-editing state. For this reason, now the isEditingGrid value is set to false for this case also.
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Wed Nov 11 12:22:58 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Wed Nov 11 16:42:20 2015 +0100
@@ -3572,6 +3572,7 @@
return;
}
this._hidingInlineEditor = true;
+ this.view.isEditingGrid = false;
if (record && (rowNum === 0 || rowNum)) {
if (!this.rowHasErrors(rowNum)) {
record[this.recordBaseStyleProperty] = null;
@@ -3585,7 +3586,6 @@
} else {
isc.Log.logDebug('hideInlineEditor has NO record and editColumnLayout', 'OB');
}
- this.view.isEditingGrid = false;
// Update the tab title after the record has been saved or canceled
// to get rid of the '*' in the tab title
// See https://issues.openbravo.com/view.php?id=21709
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js Wed Nov 11 12:22:58 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js Wed Nov 11 16:42:20 2015 +0100
@@ -1837,7 +1837,7 @@
postFix;
var suffix = '';
var hasChanged = this.isShowingForm && (this.viewForm.isNew || this.viewForm.hasChanged);
- hasChanged = hasChanged || (this.isEditingGrid && (this.viewGrid.hasErrors() || this.viewGrid.getEditForm().isNew || this.viewGrid.getEditForm().hasChanged));
+ hasChanged = hasChanged || (this.isEditingGrid && this.viewGrid.getEditForm() && (this.viewGrid.hasErrors() || this.viewGrid.getEditForm().isNew || this.viewGrid.getEditForm().hasChanged));
if (hasChanged) {
prefix = '* ';
}
@@ -2289,7 +2289,9 @@
var actionObject = {
target: this,
method: this.editRecord,
- parameters: {isNewDocument: true}
+ parameters: {
+ isNewDocument: true
+ }
};
this.standardWindow.doActionAfterAutoSave(actionObject, false);
},