details:   https://code.openbravo.com/erp/devel/pi/rev/ded41677a214
changeset: 22863:ded41677a214
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Fri Apr 11 10:43:41 2014 +0200
summary:   related to issue 26238: fixed compund properties

  Filtering by compound properties was not working fine.

  Changed the way criteria is applied: before value in the field prevailed over
  cuerrent criteria, now criteria has precedence over value.

diffstat:

 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ModelDataSourceService.java
 |  16 ++++++---
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (26 lines):

diff -r b72329997994 -r ded41677a214 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ModelDataSourceService.java
--- 
a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ModelDataSourceService.java
 Thu Apr 10 18:41:31 2014 +0200
+++ 
b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ModelDataSourceService.java
 Fri Apr 11 10:43:41 2014 +0200
@@ -66,12 +66,16 @@
   public String fetch(Map<String, String> parameters) {
 
     final Entity baseEntity = getBaseEntity(parameters);
-    String propertyPath = parameters.get(PROPERTY_FIELD);
-    if ("null".equals(propertyPath) || propertyPath == null) {
-      HashMap<String, String> criteria = getCriteria(parameters);
-      if (criteria != null && criteria.containsKey(DATASOURCE_FIELD)) {
-        propertyPath = criteria.get(DATASOURCE_FIELD);
-      } else {
+    String propertyPath;
+
+    // filter based on criteria
+    HashMap<String, String> criteria = getCriteria(parameters);
+    if (criteria != null && criteria.containsKey(DATASOURCE_FIELD)) {
+      propertyPath = criteria.get(DATASOURCE_FIELD);
+    } else {
+      // when there is no criteria present, filter based on field's value
+      propertyPath = parameters.get(PROPERTY_FIELD);
+      if ("null".equals(propertyPath) || propertyPath == null) {
         propertyPath = "";
       }
     }

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to