fixed bug 27957: new child grid record fails after parent new grid record
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 19 Jan 2015 12:35:25 +0100
changeset 25723 b4f4fca525d7
parent 25722 1f7a0de3d9ae
child 25724 0b32a498249d
fixed bug 27957: new child grid record fails after parent new grid record

When a new record was created in child grid view for a child tab just after
creating its parent in grid view, it failed creating the second record for
that child tab.

The problem was caused by an extra request to child tab due to incorrect sync
between lastSelectedRecord and getSelectedRecord for parent tab, lastSelectedRecord
kept the temporary id for new records.

The solution updates the selection once the parent one has been saved.
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	Mon Jan 19 11:32:29 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Jan 19 12:35:25 2015 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -3092,6 +3092,9 @@
     if (record && record._newId) {
       record.id = record._newId;
       delete record._newId;
+      if (this.view && this.view.updateLastSelectedState) {
+        this.view.updateLastSelectedState();
+      }
     }
 
     form = this.getEditForm();