details:   https://code.openbravo.com/erp/devel/pi/rev/e5566da8d2a0
changeset: 34766:e5566da8d2a0
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Tue Sep 11 17:50:57 2018 +0200
summary:   fixes issue 39227: Form Personalization doesn't work having tree 
based fields

  The Form Personalization feature was not working when having fields based on 
a tree reference. This was happening because when building the 
pre-visualization form not all the information required by an OBTreeItem 
instance was provided.

  Now we are taking into account if the OBTreeItem instance is being built for 
the personalization form and in that case we skip the initialization of its 
components: it will be shown just as a text field.

  Besides, we are adding a check within the "moved" function to verify whether 
the "tree" property exists. This is done to avoid a JS error at that point 
after opening the personalization form.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree.js
 |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 3e0f540c5540 -r e5566da8d2a0 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree.js
        Mon Sep 10 12:40:04 2018 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree.js
        Tue Sep 11 17:50:57 2018 +0200
@@ -35,6 +35,11 @@
   tree: null,
   init: function (parameters) {
     this.pickerIconSrc = OB.Styles.OBFormField.DefaultComboBox.pickerIconSrc;
+    if (parameters.isPreviewFormItem) {
+      // Do not need to initialize the OBTreeItem components if we are in the 
personalization form
+      this.Super('init', arguments);
+      return;
+    }
     if (parameters.showTreePopupWindow !== false) {
       this.icons = [{
         src: OB.Styles.OBFormField.DefaultSearch.pickerIconSrc,
@@ -139,7 +144,9 @@
   },
 
   moved: function () {
-    this.tree.updatePosition();
+    if (this.tree) {
+      this.tree.updatePosition();
+    }
     return this.Super('moved', arguments);
   },
 


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to