details:   /erp/devel/pi/rev/5b76fe654308
changeset: 12384:5b76fe654308
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue May 24 18:21:46 2011 +0200
summary:   fixed bug 17019: old selectors didn't work in new grid

diffstat:

 
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
 |  16 ++++++---
 src/org/openbravo/erpCommon/ad_actionButton/InsertAcces.java                   
             |  15 +++++----
 2 files changed, 19 insertions(+), 12 deletions(-)

diffs (74 lines):

diff -r 326c9f9bc573 -r 5b76fe654308 
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
--- 
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
       Tue May 24 18:08:08 2011 +0200
+++ 
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
       Tue May 24 18:21:46 2011 +0200
@@ -35,6 +35,7 @@
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
+import org.openbravo.base.model.domaintype.SearchDomainType;
 import org.openbravo.base.structure.IdentifierProvider;
 import org.openbravo.base.util.Check;
 import org.openbravo.client.kernel.RequestContext;
@@ -369,9 +370,7 @@
     if (fieldName.equals(JsonConstants.IDENTIFIER)
         || fieldName.endsWith("." + JsonConstants.IDENTIFIER)) {
       clause = computeLeftWhereClauseForIdentifier(property, fieldName, 
clause);
-    }
-
-    if (!property.isPrimitive()) {
+    } else if (!property.isPrimitive()) {
       clause = clause + ".id";
     }
 
@@ -433,10 +432,13 @@
     if (value == null) {
       return value;
     }
-    // a FK
-    if (!property.isPrimitive()) {
+
+    // a FK. Old selectors is an special key, though they are not primitive 
they should be treated
+    // as text
+    if (!property.isPrimitive() && !(property.getDomainType() instanceof 
SearchDomainType)) {
       return value;
     }
+
     if (isLike(operator)) {
       if (operator.equals(OPERATOR_CONTAINS) || 
operator.equals(OPERATOR_ICONTAINS)
           || operator.equals(OPERATOR_CONTAINSFIELD)) {
@@ -458,6 +460,10 @@
       return typedValues;
     }
 
+    if (property.getDomainType() instanceof SearchDomainType) {
+      return value;
+    }
+
     if (Boolean.class == property.getPrimitiveObjectType()) {
       return new Boolean(value.toString());
     } else if (property.isNumericType()) {
diff -r 326c9f9bc573 -r 5b76fe654308 
src/org/openbravo/erpCommon/ad_actionButton/InsertAcces.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/InsertAcces.java      Tue May 
24 18:08:08 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/InsertAcces.java      Tue May 
24 18:21:46 2011 +0200
@@ -173,13 +173,14 @@
               InsertAccesData.insertProcess(this, accesData[i].printreport, 
roleid, vars
                   .getClient(), "0", vars.getUser());
             }
-            if (!accesData[i].editreference.equals("")
-                    && (InsertAccesData.selectForm(this, roleid, 
accesData[i].editreference) == null || InsertAccesData
-                        .selectForm(this, roleid, 
accesData[i].editreference).equals(""))) {
-                  log4j.error("Action window fomr tab: " + 
accesData[i].editreference);
-                  InsertAccesData.insertForm(this, accesData[i].editreference, 
roleid, vars
-                      .getClient(), "0", vars.getUser());
-                }
+            /*
+             * if (!accesData[i].editreference.equals("") && 
(InsertAccesData.selectForm(this,
+             * roleid, accesData[i].editreference) == null || InsertAccesData 
.selectForm(this,
+             * roleid, accesData[i].editreference).equals(""))) {
+             * log4j.error("Action window fomr tab: " + 
accesData[i].editreference);
+             * InsertAccesData.insertForm(this, accesData[i].editreference, 
roleid, vars
+             * .getClient(), "0", vars.getUser()); }
+             */
             InsertAccesData[] buttons = 
InsertAccesData.selectWindowButtons(this,
                 accesData[i].adwindowid, roleid);
             if (buttons != null && buttons.length > 0) {

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to