related to issue 31434: improvement to not execute the same method two times
authorCarlos Aristu <carlos.aristu@openbravo.com>
Wed, 11 Nov 2015 19:20:24 +0100
changeset 27856 760f25c01ef4
parent 27855 bc003391103b
child 27857 b48e8a24dcb3
related to issue 31434: improvement to not execute the same method two times
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Wed Nov 11 19:12:51 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Wed Nov 11 19:20:24 2015 +0100
@@ -3294,8 +3294,9 @@
       if (record && record._new) {
         // after cancelling a not saved record, the value for the selected record should be cleared
         // see issue https://issues.openbravo.com/view.php?id=31434
-        if (me.selection && me.getSelectedRecord()) {
-          me.selection.deselect(me.getSelectedRecord());
+        var selectedRecord = me.getSelectedRecord();
+        if (me.selection && selectedRecord) {
+          me.selection.deselect(selectedRecord);
         }
         totalRows = me.data.totalRows;
         me.data.handleUpdate('remove', [{