From 112eadc8fcfb8f86d029250b9ef217c923661d79 Mon Sep 17 00:00:00 2001 From: hengsin Date: Fri, 23 Jun 2023 18:20:25 +0800 Subject: [PATCH] IDEMPIERE-5764 [ZOOM] - Window configured in reference does not work (#1906) --- .../WEB-INF/src/org/adempiere/webui/apps/AEnv.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java index f4f1c5f7eb..3f0c40b0a3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java @@ -477,17 +477,16 @@ public final class AEnv zoomQuery.setZoomValue(value); zoomQuery.addRestriction(column, MQuery.EQUAL, value); zoomQuery.setRecordCount(1); // guess - if (zoomQuery.getZoomTableName() != null) { - int tableId = -1; - tableId = MTable.getTable_ID(zoomQuery.getZoomTableName()); - if (value instanceof Integer && ((Integer) value).intValue() >= 0 && zoomQuery != null && zoomQuery.getZoomTableName() != null) { + int windowId = lookup.getZoom(zoomQuery); + if (windowId > 0) { + zoom(windowId, zoomQuery, lookup.getWindowNo()); + } else { + int tableId = MTable.getTable_ID(zoomQuery.getZoomTableName()); + if (value instanceof Integer && ((Integer) value).intValue() >= 0) { zoom(tableId, ((Integer) value).intValue(), zoomQuery, lookup.getWindowNo()); } else { zoomUU(tableId, value.toString(), zoomQuery, lookup.getWindowNo()); } - } else { - int windowId = lookup.getZoom(zoomQuery); - zoom(windowId, zoomQuery, lookup.getWindowNo()); } }