details:   https://code.openbravo.com/erp/devel/pi/rev/d500176d7771
changeset: 17800:d500176d7771
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Wed Aug 29 13:05:11 2012 +0200
summary:   Fixes issue 21352: Enter key duplicates the line number in sales 
order line
Enable waitForSave so that save is done before initial FIC of next edit line. 
Make sure that the validation of number items sets the correct value.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
 |   3 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
                |  13 +++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r 4544b6690ed6 -r d500176d7771 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
      Wed Aug 29 12:17:23 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
      Wed Aug 29 13:05:11 2012 +0200
@@ -474,7 +474,7 @@
   }
 
   type = item.typeInstance;
-  validator.resultingValue = null;
+  delete validator.resultingValue;
 
   // return a formatted value, if it was valid
   if (isc.isA.String(value)) {
@@ -491,6 +491,7 @@
       return false;
     }
   } else if (isc.isA.Number(value)) {
+    validator.resultingValue = value;
     return true;
   }
   // don't loose illegal values
diff -r 4544b6690ed6 -r d500176d7771 
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 Aug 29 12:17:23 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Wed Aug 29 13:05:11 2012 +0200
@@ -125,7 +125,9 @@
   // it is better to allow fast grid interaction and if an error occurs
   // dismiss any new records being edited and go back to the edit row
   // which causes the error
-  waitForSave: false,
+  // set to true to solve this issue:
+  // https://issues.openbravo.com/view.php?id=21352
+  waitForSave: true,
   stopOnErrors: false,
   confirmDiscardEdits: false,
   canMultiSort: false,
@@ -2166,6 +2168,15 @@
     var nextEditCell = ((rowNum || rowNum === 0) && (colNum || colNum === 0) ? 
this.getNextEditCell(rowNum, colNum, editCompletionEvent) : null);
     var newRow = nextEditCell && nextEditCell[0] !== rowNum;
     var enterKey = editCompletionEvent === 'enter';
+
+    // no newValue, compute it, this because in the super method there is a 
check
+    // how many arguments are passed on, sometimes the newValue is not passed 
in
+    // and then it must be recomputed, so if we then use the undefined newValue
+    // in the actionObject below things will go wrong
+    if (arguments.length < 2) {
+      newValue = this.getEditValue(rowNum, colNum);
+    }
+
     if (!this.view.standardWindow.isAutoSaveEnabled() && !enterKey && 
!autoSaveDone && newRow && (editForm.hasChanged || editForm.isNew)) {
       var actionObject = {
         target: this,

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to