Fixes issue 19364: Payment Monitor section in the Invoices does not appear
authorMartin Taal <martin.taal@openbravo.com>
Tue, 27 Dec 2011 20:22:17 +0100
changeset 15069 64d052b2718e
parent 15068 c8694d443367
child 15070 9e5b0a0ffea5
Fixes issue 19364: Payment Monitor section in the Invoices does not appear
Solve typo and change the way the visibility of section is computed
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-section.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-section.js	Mon Dec 19 10:53:17 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-section.js	Tue Dec 27 20:22:17 2011 +0100
@@ -75,7 +75,7 @@
         if (item.hiddenInForm) {
           continue;
         }
-        if (item.visible || item.displayed !== false) {
+        if (item.displayed !== false) {
           item.alwaysTakeSpace = flag;
         }
       }
@@ -95,11 +95,15 @@
     var ret = this.Super('expandSection', arguments);
     return ret;
   },
-
+    
   showIf: function(item, value, form, values) {
     var i, field, length;
+    
+    if(!this.itemIds) {
+      return false;
+    }
 
-    if(!this.itemIds) {
+    if (item.hiddenInForm === true || item.displayed === false ) {
       return false;
     }
     
@@ -108,7 +112,7 @@
     for (i = 0; i < length; i++) {
       field = form.getItem(this.itemIds[i]);
 
-      if(!field || (item.visible === false || item.displayed === false || item.hiddenInForm === true)) {
+      if(!field || field.displayed === false || field.hiddenInForm === true) {
         continue;
       }
 
@@ -120,6 +124,7 @@
         return true;
       }
     }
+    
     return false;
   }
 });
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Dec 19 10:53:17 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Tue Dec 27 20:22:17 2011 +0100
@@ -255,10 +255,12 @@
       if (enable) {
         this.noteSection.setRecordInfo(this.view.entity, this.getValue(OB.Constants.ID));
         this.noteSection.collapseSection(true);
+        delete this.noteSection.hiddenInForm;
         this.noteSection.refresh();
-        this.noteSection.show();
+        this.noteSection.show(true);
       } else {
-        this.noteSection.hide();
+        this.noteSection.hiddenInForm = true;
+        this.noteSection.hide(true);
       }
   },
   
@@ -269,9 +271,11 @@
     if (enable) {
       this.linkedItemSection.collapseSection(true);
       this.linkedItemSection.setRecordInfo(this.view.entity, this.getValue(OB.Constants.ID));
-      this.linkedItemSection.show();
+      delete this.linkedItemSection.hiddenInForm;
+      this.linkedItemSection.show(true);
     } else {
-      this.linkedItemSection.hide();
+      this.linkedItemSection.hiddenInForm = true;
+      this.linkedItemSection.hide(true);
     }
   },
   
@@ -279,12 +283,14 @@
     if (!this.attachmentsSection) {
       return;
     }
-    if(enable){
+    if (enable) {
       this.attachmentsSection.collapseSection(true);
       this.attachmentsSection.setRecordInfo(this.view.entity, this.getValue(OB.Constants.ID), this.view.tabId);
-      this.attachmentsSection.show();
-    }else{
-      this.attachmentsSection.hide();
+      delete this.attachmentsSection.hiddenInForm;
+      this.attachmentsSection.show(true);
+    } else {
+      this.attachmentsSection.hiddenInForm = true;
+      this.attachmentsSection.hide(true);
     }
   },