related to bug 32375: make preference resolution more consistent
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 04 Mar 2016 08:48:31 +0100
changeset 28826 bc3e4c65d7b1
parent 28825 6a656a96298b
child 28827 94f9263bb271
related to bug 32375: make preference resolution more consistent

In case of several preferences defined for a given property/attribute, the
result of getting value could be undetermistic.

Solved by sorting by preference's id in these cases.
src/org/openbravo/erpCommon/businessUtility/Preferences.java
--- a/src/org/openbravo/erpCommon/businessUtility/Preferences.java	Fri Mar 04 08:45:40 2016 +0100
+++ b/src/org/openbravo/erpCommon/businessUtility/Preferences.java	Fri Mar 04 08:48:31 2016 +0100
@@ -449,6 +449,8 @@
       parameters.add(property);
     }
 
+    hql.append(" order by p.id");
+
     OBQuery<Preference> qPref = OBDal.getInstance().createQuery(Preference.class, hql.toString());
     qPref.setParameters(parameters);
     qPref.setFilterOnActive(activeFilterEnabled);