Fixes issue 28727: Set properly the value of fk combo items in P&E windows
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 16 Mar 2015 18:35:40 +0100
changeset 26194 8e0a9e1ef5c3
parent 26193 1c38281215d7
child 26195 0a80ccfcebd0
Fixes issue 28727: Set properly the value of fk combo items in P&E windows

The problem was that when the value was being set to fk combo items before its valueMap was defined. To fix this, the value of the combo is reset just after defining its combo.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Mon Mar 16 18:39:38 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Mon Mar 16 18:35:40 2015 +0100
@@ -703,10 +703,15 @@
     if (columnValue.entries) {
       this.setValueMap(field.name, columnValue.entries);
     } else if (field.fkField && columnValue.value && columnValue.identifier) {
+      // build the valueMap manually, set it and set the value of the
+      // fk combo item in the edit form if possible
       valueMap[0] = {};
       valueMap[0][OB.Constants.ID] = columnValue.value;
       valueMap[0][OB.Constants.IDENTIFIER] = columnValue.identifier;
       this.setValueMap(field.name, valueMap);
+      if (this.isEditing()) {
+          this.setEditValue(this.getEditRow(), field.name, columnValue.value);  
+      }
     }
   },