IDEMPIERE-1351 Quick Entry when Field can not zoom to 2 different windows.

This commit is contained in:
Heng Sin Low 2013-09-11 13:06:43 +08:00
parent 6eaa8be4e4
commit ed4f7e42e7
3 changed files with 14 additions and 3 deletions

View File

@ -121,6 +121,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
if (lookup != null) {
int winID = lookup.getZoom();
int winIDPO = lookup.getZoom(false) ;
Boolean canAccess = MRole.getDefault().getWindowAccess(winID);
if (winID <= 0 || canAccess == null || ! canAccess) {
this.zoomEnabled = false;
@ -144,13 +145,13 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
+ "FROM AD_Field f "
+ " JOIN AD_Tab t "
+ " ON ( t.AD_Tab_ID = f.AD_Tab_ID ) "
+ "WHERE t.AD_Window_ID = ? "
+ "WHERE t.AD_Window_ID IN (?,?) "
+ " AND f.IsActive = 'Y' "
+ " AND t.IsActive = 'Y' "
+ " AND f.IsQuickEntry = 'Y' "
+ " AND (t.TabLevel = 0 "
+ " AND t.AD_Table_ID IN (SELECT AD_Table_ID FROM AD_Table WHERE TableName = ? )) ",
winID,tableName);
winID,winIDPO,tableName);
if (cnt > 0) {
this.newEnabled = true;
this.updateEnabled = true;

View File

@ -494,7 +494,10 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
if(!getComponent().isEnabled())
return;
final WQuickEntry vqe = new WQuickEntry (lookup.getWindowNo(), lookup.getZoom());
int zoomWindowId = gridField != null ? lookup.getZoom(Env.isSOTrx(Env.getCtx(), gridField.getWindowNo())) : lookup.getZoom(Env.isSOTrx(Env.getCtx()));
final WQuickEntry vqe = new WQuickEntry (lookup.getWindowNo(), zoomWindowId);
if (vqe.getQuickFields()<=0)
return;
int Record_ID = 0;
// if update, get current value

View File

@ -516,5 +516,12 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
editor.setVisible(field.isDisplayed(true));
}
} // dynamicDisplay
/**
* get size quickfields
*/
public int getQuickFields(){
return quickFields.size();
}// size of quickfields
} // WQuickEntry