Related to issue 18767: More filter expressions that do not work
authorMartin Taal <martin.taal@openbravo.com>
Thu, 13 Oct 2011 09:45:36 +0200
changeset 13966 d70a5e662ec8
parent 13965 b70cd891bd28
child 13967 4e9fa8e7edbc
Related to issue 18767: More filter expressions that do not work
Fix # and disappearing of count in grid
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Thu Oct 13 14:11:48 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Thu Oct 13 09:45:36 2011 +0200
@@ -714,6 +714,7 @@
     }
     if (this.filterEditor && this.filterEditor.getEditForm()) {
       this.filterEditor.getEditForm().setValue(isc.OBViewGrid.EDIT_LINK_FIELD_NAME, newValue);
+      this.filterEditor.getEditForm().getField(isc.OBViewGrid.EDIT_LINK_FIELD_NAME).defaultValue = newValue;
     }
   },
   
@@ -1380,6 +1381,7 @@
     }
     if (this.filterEditor) {
       this.filterEditor.getEditForm().setValue(this.getCheckboxField().name, newValue);
+      this.filterEditor.getEditForm().getField(this.getCheckboxField().name).defaultValue = newValue;
     }
   },
   
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Thu Oct 13 14:11:48 2011 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Thu Oct 13 09:45:36 2011 +0200
@@ -308,13 +308,15 @@
       // create the clauses, re-uses the code in parseSimpleClause
       // which translates a lesserthan/greater than to the end/start
       // time of a date
-      if (operator.equals(OPERATOR_EQUALS)) {
-        return "(" + parseSimpleClause(fieldName, OPERATOR_GREATEROREQUAL, value) + " and "
-            + parseSimpleClause(fieldName, OPERATOR_LESSOREQUAL, value) + ")";
+      if (property.isDate() || property.isDatetime()) {
+        if (operator.equals(OPERATOR_EQUALS)) {
+          return "(" + parseSimpleClause(fieldName, OPERATOR_GREATEROREQUAL, value) + " and "
+              + parseSimpleClause(fieldName, OPERATOR_LESSOREQUAL, value) + ")";
 
-      } else {
-        return "(" + parseSimpleClause(fieldName, OPERATOR_GREATEROREQUALFIELD, value) + " and "
-            + parseSimpleClause(fieldName, OPERATOR_LESSOREQUALFIElD, value) + ")";
+        } else {
+          return "(" + parseSimpleClause(fieldName, OPERATOR_GREATEROREQUALFIELD, value) + " and "
+              + parseSimpleClause(fieldName, OPERATOR_LESSOREQUALFIElD, value) + ")";
+        }
       }
     }