IDEMPIERE-837 Zk: Zoom to purchase order from invoice (vendor) doesn't work for new record.
This commit is contained in:
parent
3fd80354bf
commit
3a922e95a4
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<ADWindow>() {
|
||||
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<ADWindow>() {
|
||||
@Override
|
||||
public void onCallback(ADWindow result) {
|
||||
if(result == null)
|
||||
|
|
Loading…
Reference in New Issue