IDEMPIERE-5405 - Drill Assistant - potential Cross Tenant Issue on Table tab (#1461)

* IDEMPIERE-5405 - Drill Assistant - potential Cross Tenant Issue on Table tab

* IDEMPIERE-5405 - include System Print Formats, add ORDER BY
This commit is contained in:
Peter Takács 2022-10-11 13:10:52 +02:00 committed by GitHub
parent 1646074a59
commit 4474a0ede2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -387,7 +387,9 @@ public class WDrillReport extends Window implements EventListener<Event> {
private KeyNamePair findTablePrintFormat(KeyNamePair drillTable) {
Integer printFormatID = new Query(Env.getCtx(), MPrintFormat.Table_Name, " AD_Table_ID = ? ", null).setParameters(drillTable.getKey()).firstId();
Integer printFormatID = new Query(Env.getCtx(), MPrintFormat.Table_Name, " AD_Table_ID = ? AND AD_Client_ID IN (0,?) ", null)
.setOrderBy(" IsDefault DESC, Created DESC ")
.setParameters(drillTable.getKey(), Env.getAD_Client_ID(Env.getCtx())).firstId();
return new KeyNamePair((printFormatID != null && printFormatID > 0) ? printFormatID : 0, drillTable.getName());
}