diff --git a/org.adempiere.base/src/org/compiere/model/MQuery.java b/org.adempiere.base/src/org/compiere/model/MQuery.java index 55cc52d4d7..9541ebd63b 100644 --- a/org.adempiere.base/src/org/compiere/model/MQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MQuery.java @@ -55,7 +55,7 @@ public class MQuery implements Serializable, Cloneable /** * */ - private static final long serialVersionUID = 4726305684993324747L; + private static final long serialVersionUID = -8671209250739719461L; /** * Get Query from Parameter @@ -805,6 +805,8 @@ public class MQuery implements Serializable, Cloneable /** * Add Restriction * @param whereClause SQL WHERE clause + * @param andCondition + * @param joinDepth */ public void addRestriction (String whereClause, boolean andCondition, int joinDepth) { @@ -814,6 +816,22 @@ public class MQuery implements Serializable, Cloneable m_list.add(r); m_newRecord = whereClause.equals(NEWRECORD); } // addRestriction + + /** + * Add Restriction + * @param whereClause SQL WHERE clause + * @param joinDepth + * @param andOrCondition + */ + public void addRestriction (String whereClause, int joinDepth, String andOrCondition) + { + if (whereClause == null || whereClause.trim().length() == 0) + return; + Restriction r = new Restriction (whereClause, andOrCondition, joinDepth); + m_list.add(r); + m_newRecord = whereClause.equals(NEWRECORD); + } // addRestriction + /** * Add Restriction * @param whereClause SQL WHERE clause diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 46957d73e7..4a62db5fc5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -1926,16 +1926,16 @@ public class FindWindow extends Window implements EventListener, ValueCha if (!(parsedValue instanceof Integer)) { continue; } - m_query.addRestriction(getSubCategoryWhereClause(field, ((Integer) parsedValue).intValue()), andOr, openBrackets); + m_query.addRestriction(getSubCategoryWhereClause(field, ((Integer) parsedValue).intValue()), openBrackets, andOr); } else if ((field.getDisplayType()==DisplayType.ChosenMultipleSelectionList||field.getDisplayType()==DisplayType.ChosenMultipleSelectionSearch||field.getDisplayType()==DisplayType.ChosenMultipleSelectionTable) && (MQuery.OPERATORS[MQuery.EQUAL_INDEX].getValue().equals(Operator) || MQuery.OPERATORS[MQuery.NOT_EQUAL_INDEX].getValue().equals(Operator))) { String clause = DB.intersectClauseForCSV(ColumnSQL, parsedValue.toString()); if (MQuery.OPERATORS[MQuery.EQUAL_INDEX].getValue().equals(Operator)) - m_query.addRestriction(clause, andOr, openBrackets); + m_query.addRestriction(clause, openBrackets, andOr); else - m_query.addRestriction("NOT (" + clause + ")", andOr, openBrackets); + m_query.addRestriction("NOT (" + clause + ")", openBrackets, andOr); } else m_query.addRestriction(ColumnSQL, Operator, parsedValue,