Fixes issue 30060: Select Payments Pick&Edit window is not working properly
authorCarlos Aristu <carlos.aristu@openbravo.com>
Tue, 09 Jun 2015 18:14:54 +0200
changeset 26886 ee157fef9c33
parent 26885 780731085f0c
child 26887 ba6a63e37880
Fixes issue 30060: Select Payments Pick&Edit window is not working properly

When selecting a record in a P&E grid, the request done to the FIC was not using the correct mode. Now, when selecting a record, the request is properly done using the EDIT mode.
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	Tue Jun 09 18:01:36 2015 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Tue Jun 09 18:14:54 2015 +0200
@@ -793,13 +793,17 @@
   },
 
   retrieveInitialValues: function (rowNum, colNum, newCell, newRow, suppressFocus) {
-    var requestParams, allProperties, i, record;
+    var requestParams, allProperties, i, record, newRecord;
 
     allProperties = this.getContextInfo(rowNum);
     record = this.getRecord(rowNum);
 
+    // we can't rely on newRow value to know if we're inserting a new record,
+    // a new record is being created if record has no value
+    newRecord = !record;
+
     requestParams = {
-      MODE: (newRow ? 'NEW' : 'EDIT'),
+      MODE: (newRecord ? 'NEW' : 'EDIT'),
       PARENT_ID: null,
       TAB_ID: this.viewProperties.tabId,
       ROW_ID: (!newRow && record ? record[OB.Constants.ID] : null)