details:   https://code.openbravo.com/erp/devel/pi/rev/40963c034a8f
changeset: 32597:40963c034a8f
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Tue Aug 29 10:10:18 2017 +0200
summary:   fixes bug 36716: Tree view stops working when returning back from 
form view

When opening the form view of a tree view node, Smartclient copies the values 
of the node properties into the form but skipping the properties involved in 
the tree management (these properties the child nodes are also not copied).

When returning back from the form view, the tree node is refreshed with the 
values of the properties stored in the form. This caused the lost of the tree 
information of the child nodes because, as mentioned before, the tree 
properties were not copied when opening the form view.

Apart from the skipped properties, the tree information of the child nodes 
should not have changed in form view. Therefore, to fix the problem now we do 
not override the children information when returning from the form view.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js
 |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5cc5810286e5 -r 40963c034a8f 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js
        Mon Aug 28 17:25:36 2017 -0400
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js
        Tue Aug 29 10:10:18 2017 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013-2016 Openbravo SLU
+ * All portions are Copyright (C) 2013-2017 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -453,11 +453,12 @@
 
   // refreshes record after edition
   refreshRecord: function (values) {
-    var record, p;
+    var record, p, childrenProperty;
     record = this.getNodeByID(values.id);
     if (record) {
+      childrenProperty = this.data ? this.data.childrenProperty : 'children';
       for (p in values) {
-        if (values.hasOwnProperty(p)) {
+        if (values.hasOwnProperty(p) && p !== childrenProperty) {
           record[p] = values[p];
         }
       }

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to