details:   https://code.openbravo.com/erp/devel/pi/rev/747998ff0bb6
changeset: 33036:747998ff0bb6
user:      Inigo Sanchez <inigo.sanchez <at> openbravo.com>
date:      Tue Nov 21 17:58:52 2017 +0100
summary:   Fixed issue 36406: Summary functions do not work in tabs based on 
Datasources.

The summary functions didn't work in tabs based on Datasources because this
functionality was not developed. The reported datasource hadn't the code to
managed summary functions properly.

To avoid this problem, it has been resolved by blocking the use of the summary
functions in the tabs based on Datasources.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java
 |  13 ++++++---
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 2a22d8f5a9db -r 747998ff0bb6 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java
     Tue Nov 21 13:43:40 2017 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java
     Tue Nov 21 17:58:52 2017 +0100
@@ -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):  ______________________________________.
  ************************************************************************
@@ -409,11 +409,12 @@
   }
 
   /**
-   * Returns true if the grid allows adding summary functions. If the tab is 
based on an HQL table,
-   * this method is returning false because grid summaries are not allowed for 
this kind of tables.
+   * Returns true if the grid allows adding summary functions. If the tab is 
based on an HQL table
+   * or Datasource table, this method is returning false because grid 
summaries are not allowed for
+   * these kind of tables.
    */
   public boolean getAllowSummaryFunctions() {
-    if (isHqlBasedTable(tab.getTable())) {
+    if (isHqlBasedTable(tab.getTable()) || 
isDatasourceBasedTable(tab.getTable())) {
       return false;
     }
     return isConfigurationPropertyEnabled(GCTab.PROPERTY_ALLOWSUMMARYFUNCTIONS,
@@ -471,4 +472,8 @@
   private boolean isHqlBasedTable(Table table) {
     return 
ApplicationConstants.HQLBASEDTABLE.equals(table.getDataOriginType());
   }
+
+  private boolean isDatasourceBasedTable(Table table) {
+    return 
!ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType());
+  }
 }

------------------------------------------------------------------------------
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
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to