IDEMPIERE-56 / IDEMPIERE-4723 Clean up iDempiere's code (#1402)

Cleanup useless code - as the value is assigned the condition below is always true
This commit is contained in:
Carlos Ruiz 2022-07-21 12:37:27 +02:00 committed by GitHub
parent b0e7389f0a
commit 9a977d6e16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 41 deletions

View File

@ -382,16 +382,11 @@ public final class AEnv
{
if (lookup == null)
return;
//
MQuery zoomQuery = lookup.getZoomQuery();
// still null means the field is empty or not selected item
if (value == null)
value = -1;
// If not already exist or exact value
if (zoomQuery == null || value != null)
{
zoomQuery = new MQuery(); // ColumnName might be changed in MTab.validateQuery
//
MQuery zoomQuery = new MQuery(); // ColumnName might be changed in MTab.validateQuery
String column = lookup.getColumnName();
// Check if it is a List Reference
if (lookup instanceof MLookup)
@ -425,7 +420,6 @@ public final class AEnv
zoomQuery.setZoomValue(value);
zoomQuery.addRestriction(column, MQuery.EQUAL, value);
zoomQuery.setRecordCount(1); // guess
}
if (value instanceof Integer && ((Integer) value).intValue() >= 0 && zoomQuery != null && zoomQuery.getZoomTableName() != null) {
int tableId = MTable.getTable_ID(zoomQuery.getZoomTableName());
zoom(tableId, ((Integer) value).intValue(), zoomQuery, lookup.getWindowNo());