Skip to content

Commit

Permalink
fix: Smart Browser omit isInfoOnly fields from query criteria. (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Sep 25, 2023
1 parent acd8043 commit f23d847
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/spin/base/db/WhereClauseUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ public static String getBrowserWhereClauseFromCriteria(MBrowse browser, Criteria
String rangeColumnName = columnName.substring(0, columnName.length() - "_To".length());
browseField = browseFields.get(rangeColumnName);
}
if (browseField == null) {
if (browseField == null || browseField.isInfoOnly()) {
return;
}
MViewColumn viewColumn = browseField.getAD_View_Column();
Expand All @@ -829,9 +829,9 @@ public static String getBrowserWhereClauseFromCriteria(MBrowse browser, Criteria
.orElse(Condition.newBuilder().build())
;
valueTo = conditionEnd.getValue();
operatorValue = conditionEnd.getOperatorValue();
operatorTo = conditionEnd.getOperatorValue();
if (conditionStart.getOperatorValue() > 0 && operatorValue == Operator.VOID_VALUE) {
operatorValue = conditionStart.getOperatorValue();
operatorTo = conditionStart.getOperatorValue();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2928,8 +2928,10 @@ private ListBrowserItemsResponse.Builder listBrowserItems(ListBrowserItemsReques
throw new AdempiereException("@AD_Browse_ID@ @WhereClause@ @Unparseable@");
}
whereClause
.append(" AND ")
.append(parsedWhereClause);
.append(" AND (")
.append(parsedWhereClause)
.append(")")
;
}

// For dynamic condition
Expand Down

0 comments on commit f23d847

Please sign in to comment.