Fixes issue 21533: Showif computation now supports boolean values
authorAugusto Mauch <augusto.mauch@openbravo.com>
Fri, 07 Sep 2012 13:57:57 +0200
changeset 17884 6b2ba000fb7a
parent 17883 75de952086ec
child 17885 3ea3272118cd
Fixes issue 21533: Showif computation now supports boolean values

Now, before trying to execute the originalShowIf property, it is checked if it is set to 'true' or 'false'. In that case, it is assigned to originalShowIfValue the corresponding boolean. If not, it is executed as a function as usual.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Fri Sep 07 13:14:13 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Fri Sep 07 13:57:57 2012 +0200
@@ -2069,7 +2069,13 @@
         OB.Utilities.fixNull250(currentValues);
 
         try {
-          originalShowIfValue = this.originalShowIf(item, value, form, currentValues, context);
+          if (this.originalShowIf === 'true') {
+            originalShowIfValue = true;
+          } else if (this.originalShowIf === 'false') {
+            originalShowIfValue = false;
+          } else {
+            originalShowIfValue = this.originalShowIf(item, value, form, currentValues, context);
+          }
         } catch (_exception) {
           isc.warn(_exception + ' ' + _exception.message + ' ' + _exception.stack);
         }