IDEMPIERE-2207 Use of virtual column in search is broken
This commit is contained in:
parent
d4e227aafe
commit
212cfc4a0f
|
@ -1108,9 +1108,20 @@ class Restriction implements Serializable
|
||||||
{
|
{
|
||||||
if (DirectWhereClause != null)
|
if (DirectWhereClause != null)
|
||||||
return DirectWhereClause;
|
return DirectWhereClause;
|
||||||
|
// verify if is a virtual column, do not prefix tableName if this is a virtualColumn
|
||||||
|
boolean virtualColumn = false;
|
||||||
|
if (tableName != null && tableName.length() > 0) {
|
||||||
|
MTable table = MTable.get(Env.getCtx(), tableName);
|
||||||
|
for (MColumn col : table.getColumns(false)) {
|
||||||
|
if (ColumnName.equals(col.getColumnSQL())) {
|
||||||
|
virtualColumn = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (tableName != null && tableName.length() > 0)
|
if (!virtualColumn && tableName != null && tableName.length() > 0)
|
||||||
{
|
{
|
||||||
// Assumes - REPLACE(INITCAP(variable),'s','X') or UPPER(variable)
|
// Assumes - REPLACE(INITCAP(variable),'s','X') or UPPER(variable)
|
||||||
int pos = ColumnName.lastIndexOf('(')+1; // including (
|
int pos = ColumnName.lastIndexOf('(')+1; // including (
|
||||||
|
|
Loading…
Reference in New Issue