fixes issue 32202: Error in add payment when editing the amount of a record
authorCarlos Aristu <carlos.aristu@openbravo.com>
Thu, 11 Feb 2016 15:57:36 +0100
changeset 28592 670d9903e705
parent 28591 9780a5222687
child 28593 408e578e3673
fixes issue 32202: Error in add payment when editing the amount of a record

The entered value is being set on the changed method for number items. This is done in order to prevent placing the decimal separator in a wrong place. This problem only affects to standard windows.

To solve the problem we only set the number item value in the changed method when we are not in a pick and edit window but in a standard window.
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	Fri Feb 05 12:02:24 2016 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Thu Feb 11 15:57:36 2016 +0100
@@ -41,11 +41,8 @@
     return this.Super('init', arguments);
   },
 
-  // after a change also store the textual value in the form
-  // for precision, the textual value is sent to the server
-  // which can be transferred to a bigdecimal there
   changed: function (form, item, value) {
-    if (item && item.setValue) {
+    if (this.form.className === 'OBViewForm' && item && item.setValue) {
       item.setValue(this.getEnteredValue());
     }
     this.Super('changed', arguments);