IDEMPIERE-4703 Cross tenant issue on sort tabs (#584)

This commit is contained in:
Carlos Ruiz 2021-02-14 03:06:59 +01:00 committed by GitHub
parent 51a081cbe7
commit ff88459dc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -421,6 +421,7 @@ public class ADSortTab extends Panel implements IADTabpanel
if (m_IdentifierTranslated) if (m_IdentifierTranslated)
sql.append(" AND t.").append(m_KeyColumnName).append("=tt.").append(m_KeyColumnName) sql.append(" AND t.").append(m_KeyColumnName).append("=tt.").append(m_KeyColumnName)
.append(" AND tt.AD_Language=?"); .append(" AND tt.AD_Language=?");
sql.append(" AND t.AD_Client_ID IN (0,?)");
// Order // Order
sql.append(" ORDER BY "); sql.append(" ORDER BY ");
if (m_ColumnYesNoName != null) if (m_ColumnYesNoName != null)
@ -441,11 +442,14 @@ public class ADSortTab extends Panel implements IADTabpanel
ResultSet rs = null; ResultSet rs = null;
try try
{ {
int idx = 1;
pstmt = DB.prepareStatement(sql.toString(), null); pstmt = DB.prepareStatement(sql.toString(), null);
pstmt.setInt(1, ID); pstmt.setInt(idx++, ID);
if (m_IdentifierTranslated) if (m_IdentifierTranslated)
pstmt.setString(2, Env.getAD_Language(Env.getCtx())); pstmt.setString(idx++, Env.getAD_Language(Env.getCtx()));
pstmt.setInt(idx++, Env.getAD_Client_ID(Env.getCtx()));
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())