diff --git a/org.adempiere.base/src/org/compiere/model/Lookup.java b/org.adempiere.base/src/org/compiere/model/Lookup.java index ed1ce3b392..ba32408a50 100644 --- a/org.adempiere.base/src/org/compiere/model/Lookup.java +++ b/org.adempiere.base/src/org/compiere/model/Lookup.java @@ -428,6 +428,15 @@ public abstract class Lookup extends AbstractListModel return 0; } // getZoom + /** + * @param isSOTrx + * @return Zoom AD_Window_ID + */ + public int getZoom(boolean isSOTrx) + { + return 0; + } + /** * Get Zoom - default implementation * @param query query diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index c27769eea2..f7d9820e24 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -563,6 +563,7 @@ public final class MLookup extends Lookup implements Serializable * @param query query * @return Zoom Window */ + @Override public int getZoom(MQuery query) { if (m_info.ZoomWindowPO == 0 || query == null) @@ -570,11 +571,18 @@ public final class MLookup extends Lookup implements Serializable // Need to check SO/PO boolean isSOTrx = DB.isSOTrx(m_info.TableName, query.getWhereClause(false)); // - if (!isSOTrx) - return m_info.ZoomWindowPO; - return m_info.ZoomWindow; + return getZoom(isSOTrx); } // getZoom + @Override + public int getZoom(boolean isSOTrx) + { + if (m_info.ZoomWindowPO == 0) + return m_info.ZoomWindow; + + return isSOTrx ? m_info.ZoomWindow : m_info.ZoomWindowPO; + } + /** * Get Zoom Query String * @return Zoom SQL Where Clause diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index 4e6740b31f..8fe5986ee7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -303,7 +303,8 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value query.addRestriction("1=2"); query.setRecordCount(0); - SessionManager.getAppDesktop().openWindow(lookup.getZoom(query), query, new Callback() { + int zoomWindowId = gridField != null ? lookup.getZoom(Env.isSOTrx(Env.getCtx(), gridField.getWindowNo())) : lookup.getZoom(Env.isSOTrx(Env.getCtx())); + SessionManager.getAppDesktop().openWindow(zoomWindowId, query, new Callback() { @Override public void onCallback(ADWindow result) { if(result == null)