IDEMPIERE-1071 Problem with using Report in tab Export Format Line

This commit is contained in:
Richard Morales 2013-06-19 19:44:43 -05:00
parent 58610b535e
commit b1b6d8ba0b
2 changed files with 12 additions and 7 deletions

View File

@ -634,10 +634,11 @@ public class MLookupFactory
}
StringBuilder embedSQL = new StringBuilder("SELECT ");
boolean translated = false;
// Translated
if (IsTranslated && !Env.isBaseLanguage(language, TableName))
{
translated = true;
if (isValueDisplayed)
embedSQL.append(TableNameAlias).append(".Value||'-'||");
embedSQL.append(TableName).append("_Trl.").append(DisplayColumn);
@ -660,16 +661,19 @@ public class MLookupFactory
}
embedSQL.append(" WHERE ");
int Column_ID = MColumn.getColumn_ID(BaseTable, BaseColumn);
MColumn column = MColumn.get(Env.getCtx(), Column_ID);
// If is not virtual column - teo_sarca [ 1739530 ]
if (! BaseColumn.trim().startsWith("("))
if (!column.isVirtualColumn())
{
embedSQL.append(BaseTable).append(".").append(BaseColumn);
embedSQL.append("=").append(TableNameAlias).append(".").append(KeyColumn);
} else if (translated) {
embedSQL.append(TableNameAlias).append(".").append(BaseColumn).append("=").append(column.getColumnSQL());
} else {
embedSQL.append(BaseColumn).append("=").append(column.getColumnSQL());
}
else
{
embedSQL.append(BaseColumn);
}
embedSQL.append("=").append(TableNameAlias).append(".").append(KeyColumn);
return embedSQL.toString();
} // getLookup_TableEmbed

View File

@ -406,6 +406,7 @@ public class DataEngine
.append(lookupSQL).append(" AS ").append(ColumnName).append(",");
groupByColumns.add(m_synonym+display);
groupByColumns.add(lookupSQL);
orderName = m_synonym + display;
//
TableReference tr = getTableReference(AD_Reference_Value_ID);
String foreignColumnName = tr.KeyColumn;