modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl
changeset 28121 d9584faf499b
parent 28028 16d5a95d9323
child 28252 e91d7a38fa6b
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl	Thu Dec 10 11:57:11 2015 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl	Sun Dec 13 18:52:55 2015 +0100
@@ -40,21 +40,34 @@
             OB.Utilities.fixNull250(currentValues);
         <#list data.fieldHandler.fields as field>
         <#if field.readOnlyIf != "" && field.showIf == "">
-        // Applying readonly.
+        // Applying read only.
            f.disableItem('${field.name}', ${field.readOnlyIf});
-        <#elseif field.readOnlyIf == "" && field.showIf != "">
+        <#else>
+        <#if field.readOnlyIf == "" && field.showIf != "">
         // Applying display logic in grid.
         if (!this.view.isShowingForm) {
+        <#if field.showIf == "false">
+           f.disableItem('${field.name}', true);
+        <#else>
            f.disableItem('${field.name}', (${field.showIf}) === false);
+        </#if>
         }
-        <#elseif field.readOnlyIf != "" && field.showIf != "">
-        // Applying display logic and readonly in grid/form.
+        <#else>
+        <#if field.readOnlyIf != "" && field.showIf != "">
+        // Applying display logic and read only in grid/form.
         if (!this.view.isShowingForm) {
+        <#if field.showIf == "false">
+           // If display logic has a false value, it is only necessary take into account the read only logic.
+           f.disableItem('${field.name}', (${field.readOnlyIf}));
+        <#else>
            f.disableItem('${field.name}', (${field.readOnlyIf}) || (${field.showIf}) === false);
+        </#if>
         } else {
            f.disableItem('${field.name}', ${field.readOnlyIf});
         }
         </#if>
+        </#if>
+        </#if>
         </#list>
         // disable forced in case the fields are set as read only per role
         disabledFields = form.view.disabledFields;