Fixed issue 29561: 'Time' fields now can be set as no updateable via AD_COLUMN
authorDavid Baz Fayos <david.baz@openbravo.com>
Thu, 14 May 2015 12:15:15 +0200
changeset 26634 5a7da4d16d1d
parent 26633 135a4a43d546
child 26635 14775af5b6a0
Fixed issue 29561: 'Time' fields now can be set as no updateable via AD_COLUMN
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Thu May 14 10:55:38 2015 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Thu May 14 12:15:15 2015 +0200
@@ -227,10 +227,17 @@
     // PS: It cannot be done by overwriting 'setDisable' in the parent item, because default
     //     form states (and 'disabled: true'could be one of them), doesn't pass
     //     through 'setDisabled' function.
+    var me = this;
     if (this.parentItem.isDisabled() && !this.isDisabled()) {
-      this.setDisabled(true);
+      // Timeout to avoid fireOnPause
+      setTimeout(function () {
+        me.setDisabled(true);
+      }, 10);
     } else if (!this.parentItem.isDisabled() && this.isDisabled()) {
-      this.setDisabled(false);
+      // Timeout to avoid fireOnPause
+      setTimeout(function () {
+        me.setDisabled(false);
+      }, 10);
     }
     // SC does not handle properly styles for inner textItem representing the time,
     // this is a temporary hack till it is fixed in SC code