IDEMPIERE-5629 Error when using context variables in info window view ID column (#1725)

This commit is contained in:
Carlos Ruiz 2023-03-13 12:44:51 +01:00 committed by GitHub
parent 0bdc997efe
commit 106cbc7e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -1398,6 +1398,10 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
protected void prepareTable(ColumnInfo[] layout, String from, String where,
String orderBy) {
super.prepareTable(layout, from, where, orderBy);
addViewIDToQuery();
addKeyViewToQuery();
if (m_sqlMain.indexOf("@") >= 0) {
String sql = Env.parseContext(infoContext, p_WindowNo, m_sqlMain, true);
if (sql == null || sql.length() == 0) {
@ -1406,10 +1410,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
m_sqlMain = sql;
}
}
addViewIDToQuery();
addKeyViewToQuery();
if (m_sqlMain.length() > 0 && infoWindow.isDistinct()) {
m_sqlMain = m_sqlMain.substring("SELECT ".length());
m_sqlMain = "SELECT DISTINCT " + m_sqlMain;