From 4474a0ede2248d12247fb11e1cb8906c74e8b768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Tak=C3=A1cs?= <93127072+PeterTakacs300@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:10:52 +0200 Subject: [PATCH] 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 --- .../WEB-INF/src/org/adempiere/webui/apps/WDrillReport.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WDrillReport.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WDrillReport.java index e333c537b6..55ea7109f4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WDrillReport.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WDrillReport.java @@ -387,7 +387,9 @@ public class WDrillReport extends Window implements EventListener { 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()); }