# HG changeset patch
# User Inigo Sanchez <inigo.sanchez@openbravo.com>
# Date 1490892418 -7200
#      Thu Mar 30 18:46:58 2017 +0200
# Node ID a15fcef8c853ddf23e802ed451facccdc15cc26b
# Parent  bbb8eb9c95e26bc8f4ef4a2be12e5116a963fd19
Fixed issue 35545: No tree view on a sub-tab in some circumstances

The problem was found in an environment with the configured manufacturing
plan and the tree view in the Lines tab of the manufacturing plan. If you
have the tree view on the subtab and you want to generate the data in this
subtab you must start a process (having selected the header record and
started the Production Plan process), no data will appear on the subtab.

The problem was that the doRefreshContents method did not working as
expected with a tree view. When the this.treeGrid.fetchData command is
executed, a call to the datasource is not being made as expected.This is
occurred because SmartClient determines that the call to the datasource is
not necessary (no difference in the criteria is detected).

In order to fix this problem invalidateCache() method is used in order to
force to do a datasource call keeping the current criteria.

diff -r bbb8eb9c95e2 -r a15fcef8c853 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	Thu Mar 30 15:28:16 2017 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Thu Mar 30 18:46:58 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) 2010-2016 Openbravo SLU
+ * All portions are Copyright (C) 2010-2017 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -1269,6 +1269,10 @@
     }
 
     if (this.treeGrid && this.isShowingTree) {
+      if (this.treeGrid.data) {
+        // Force to do a datasource call keeping the current criteria
+        this.treeGrid.data.invalidateCache();
+      }
       this.treeGrid.fetchData(this.treeGrid.getCriteria());
     }
     this.viewGrid.refreshContents(callback);
