IDEMPIERE-4150 : Right click / New/Update not visible with duplicated windows (#50)
Also use ZoomConditions for Table/TableDirect editors
This commit is contained in:
parent
2e065e6e61
commit
c5038a33ca
|
@ -581,6 +581,11 @@ public class MLookupFactory
|
|||
realSQL.append(" ORDER BY 3");
|
||||
|
||||
if (s_log.isLoggable(Level.FINEST)) s_log.finest("AD_Reference_Value_ID=" + AD_Reference_Value_ID + " - " + realSQL);
|
||||
|
||||
int zoomWinID = Env.getZoomWindowID(MTable.get(ctx, TableName).getAD_Table_ID(), 0, WindowNo);
|
||||
if (zoomWinID > 0)
|
||||
ZoomWindow = zoomWinID;
|
||||
|
||||
if (overrideZoomWindow > 0)
|
||||
{
|
||||
ZoomWindow = overrideZoomWindow;
|
||||
|
@ -786,6 +791,10 @@ public class MLookupFactory
|
|||
ZoomWindow = table.getAD_Window_ID();
|
||||
ZoomWindowPO = table.getPO_Window_ID();
|
||||
|
||||
int zoomWinID = Env.getZoomWindowID(table.getAD_Table_ID(), 0, WindowNo);
|
||||
if (zoomWinID > 0)
|
||||
ZoomWindow = zoomWinID;
|
||||
|
||||
StringBuilder realSQL = new StringBuilder("SELECT ");
|
||||
realSQL.append(TableName).append(".").append(KeyColumn).append(",NULL,");
|
||||
|
||||
|
|
|
@ -141,11 +141,29 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
|
|||
Boolean canAccessZoom = MRole.getDefault().getWindowAccess(zoomCondition.getAD_Window_ID());
|
||||
if (canAccessZoom != null && canAccessZoom) {
|
||||
this.zoomEnabled = true;
|
||||
if (hasQuickEntryField(zoomCondition.getAD_Window_ID(), 0, tableName)) {
|
||||
this.newEnabled = true;
|
||||
this.updateEnabled = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int cnt = DB.getSQLValueEx(null,
|
||||
if (hasQuickEntryField(winID,winIDPO,tableName)) {
|
||||
this.newEnabled = true;
|
||||
this.updateEnabled = true;
|
||||
} else {
|
||||
this.newEnabled = false;
|
||||
this.updateEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
boolean hasQuickEntryField(int winID, int winIDPO, String tableName) {
|
||||
return DB.getSQLValueEx(null,
|
||||
"SELECT COUNT(*) "
|
||||
+ "FROM AD_Field f "
|
||||
+ " JOIN AD_Tab t "
|
||||
|
@ -156,17 +174,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
|
|||
+ " AND f.IsQuickEntry = 'Y' "
|
||||
+ " AND (t.TabLevel = 0 "
|
||||
+ " AND t.AD_Table_ID IN (SELECT AD_Table_ID FROM AD_Table WHERE TableName = ? )) ",
|
||||
winID,winIDPO,tableName);
|
||||
if (cnt > 0) {
|
||||
this.newEnabled = true;
|
||||
this.updateEnabled = true;
|
||||
} else {
|
||||
this.newEnabled = false;
|
||||
this.updateEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
init();
|
||||
winID,winIDPO,tableName) > 0;
|
||||
}
|
||||
|
||||
public boolean isZoomEnabled() {
|
||||
|
|
Loading…
Reference in New Issue