IDEMPIERE-4080 Report filtering based on parameter is not working

This commit is contained in:
Carlos Ruiz 2019-11-13 13:26:02 +01:00
parent cac5985b2a
commit 69c0c2c67b
1 changed files with 1 additions and 3 deletions

View File

@ -63,12 +63,10 @@ public class MQuery implements Serializable
if (s_log.isLoggable(Level.INFO)) s_log.info("AD_PInstance_ID=" + AD_PInstance_ID + ", TableName=" + TableName); if (s_log.isLoggable(Level.INFO)) s_log.info("AD_PInstance_ID=" + AD_PInstance_ID + ", TableName=" + TableName);
MQuery reportQuery = new MQuery(TableName); MQuery reportQuery = new MQuery(TableName);
// Temporary Tables - add qualifier (not displayed) // Temporary Tables - add qualifier (not displayed)
boolean isTemporaryTable = false;
MTable table = MTable.get(ctx, TableName); MTable table = MTable.get(ctx, TableName);
if (TableName.startsWith("T_")) if (TableName.startsWith("T_"))
{ {
reportQuery.addRestriction(TableName + ".AD_PInstance_ID=" + AD_PInstance_ID); reportQuery.addRestriction(TableName + ".AD_PInstance_ID=" + AD_PInstance_ID);
isTemporaryTable = true;
} }
//use separate query object for rendering of parameter at report //use separate query object for rendering of parameter at report
reportQuery.setReportProcessQuery(new MQuery(TableName)); reportQuery.setReportProcessQuery(new MQuery(TableName));
@ -156,7 +154,7 @@ public class MQuery implements Serializable
+ "; Name=" + Name + ", Info=" + Info + "-" + Info_To + ", Range=" + isRange); + "; Name=" + Name + ", Info=" + Info + "-" + Info_To + ", Range=" + isRange);
// //
//custom query or column not exists - render as report parameters //custom query or column not exists - render as report parameters
if (isTemporaryTable || (table != null && table.getColumn(ParameterName) == null)) if (table != null && table.getColumn(ParameterName) == null)
{ {
query = reportQuery.getReportProcessQuery(); query = reportQuery.getReportProcessQuery();
} }