Fixed issue 35658: Fields redraw instantly in grid under some circumstances
authorInigo Sanchez <inigo.sanchez@openbravo.com>
Fri, 21 Apr 2017 13:55:46 +0200
changeset 31974 bcf679ab26bb
parent 31973 f105b4fc8be0
child 31975 9c529a8c8b8d
Fixed issue 35658: Fields redraw instantly in grid under some circumstances

The problem was that numeric fields redraws instantly in grid view when a numeric field
was referenced by a read only logic. This reported problem was caused by the partial fix
of #32202 regression.

The fix of #32202 was partial because the added condition did not taken into account the
grid view properly. This problem has been resolved by take into account form and grid view.

Besides another problem was found and resolved with this fix. Since this regression was
introduced, the #23136 issue was broken too. This problem has been resolved too with this
solution.
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	Thu Apr 20 08:55:57 2017 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Fri Apr 21 13:55:46 2017 +0200
@@ -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) 2011-2015 Openbravo SLU
+ * All portions are Copyright (C) 2011-2017 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -42,7 +42,8 @@
   },
 
   changed: function (form, item, value) {
-    if (this.form.className === 'OBViewForm' && item && item.setValue) {
+    var isParamWindow = form.grid && form.grid.view && form.grid.view.paramWindow;
+    if (!isParamWindow && item && item.setValue) {
       item.setValue(this.getEnteredValue());
     }
     this.Super('changed', arguments);