Fixes issue 24741: Row saved by pressing a tab for picking a selector value
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 16 Sep 2013 15:06:01 +0200
changeset 21322 61b572f92df4
parent 21266 f731bd4e0332
child 21323 0092927931f5
Fixes issue 24741: Row saved by pressing a tab for picking a selector value

The problem was that the request to the datasource to save the new record was being done before the response of the FIC (it was called because picking a business partner triggers a callout to select its location) was received and processed. This has been fixed by delaying the execution of the cellEditEnd function until the FIC response has been processed.
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	Thu Oct 10 04:02:52 2013 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Sep 16 15:06:01 2013 +0200
@@ -2912,6 +2912,15 @@
       return;
     }
 
+    if (newRow && editCompletionEvent === 'tab' && !ficCallDone) {
+      this.setEditValue(rowNum, 'actionAfterFicReturn', {
+        target: this,
+        method: this.cellEditEnd,
+        parameters: [editCompletionEvent, newValue, true, autoSaveDone]
+      }, true, true);
+      return;
+    }
+
     // If leaving the row...
     if (editCompletionEvent === 'enter' || editCompletionEvent === 'arrow_up' || editCompletionEvent === 'arrow_down') {
       // See issue https://issues.openbravo.com/view.php?id=19830