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