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");
|
realSQL.append(" ORDER BY 3");
|
||||||
|
|
||||||
if (s_log.isLoggable(Level.FINEST)) s_log.finest("AD_Reference_Value_ID=" + AD_Reference_Value_ID + " - " + realSQL);
|
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)
|
if (overrideZoomWindow > 0)
|
||||||
{
|
{
|
||||||
ZoomWindow = overrideZoomWindow;
|
ZoomWindow = overrideZoomWindow;
|
||||||
|
|
@ -786,6 +791,10 @@ public class MLookupFactory
|
||||||
ZoomWindow = table.getAD_Window_ID();
|
ZoomWindow = table.getAD_Window_ID();
|
||||||
ZoomWindowPO = table.getPO_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 ");
|
StringBuilder realSQL = new StringBuilder("SELECT ");
|
||||||
realSQL.append(TableName).append(".").append(KeyColumn).append(",NULL,");
|
realSQL.append(TableName).append(".").append(KeyColumn).append(",NULL,");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,23 +141,16 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
|
||||||
Boolean canAccessZoom = MRole.getDefault().getWindowAccess(zoomCondition.getAD_Window_ID());
|
Boolean canAccessZoom = MRole.getDefault().getWindowAccess(zoomCondition.getAD_Window_ID());
|
||||||
if (canAccessZoom != null && canAccessZoom) {
|
if (canAccessZoom != null && canAccessZoom) {
|
||||||
this.zoomEnabled = true;
|
this.zoomEnabled = true;
|
||||||
|
if (hasQuickEntryField(zoomCondition.getAD_Window_ID(), 0, tableName)) {
|
||||||
|
this.newEnabled = true;
|
||||||
|
this.updateEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int cnt = DB.getSQLValueEx(null,
|
if (hasQuickEntryField(winID,winIDPO,tableName)) {
|
||||||
"SELECT COUNT(*) "
|
|
||||||
+ "FROM AD_Field f "
|
|
||||||
+ " JOIN AD_Tab t "
|
|
||||||
+ " ON ( t.AD_Tab_ID = f.AD_Tab_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,winIDPO,tableName);
|
|
||||||
if (cnt > 0) {
|
|
||||||
this.newEnabled = true;
|
this.newEnabled = true;
|
||||||
this.updateEnabled = true;
|
this.updateEnabled = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -169,6 +162,21 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean hasQuickEntryField(int winID, int winIDPO, String tableName) {
|
||||||
|
return DB.getSQLValueEx(null,
|
||||||
|
"SELECT COUNT(*) "
|
||||||
|
+ "FROM AD_Field f "
|
||||||
|
+ " JOIN AD_Tab t "
|
||||||
|
+ " ON ( t.AD_Tab_ID = f.AD_Tab_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,winIDPO,tableName) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isZoomEnabled() {
|
public boolean isZoomEnabled() {
|
||||||
return zoomEnabled;
|
return zoomEnabled;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue