IDEMPIERE-2152 - fix error when Info Window has a non-displayed key and a process -> InfoWindow.getColumnValue: column play keyView should is integer

This commit is contained in:
Carlos Ruiz 2019-03-26 21:22:24 -03:00
parent d42372df50
commit 8d5a15aa34
1 changed files with 12 additions and 4 deletions

View File

@ -81,6 +81,7 @@ import org.compiere.model.X_AD_CtxHelp;
import org.compiere.process.ProcessInfo;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
@ -718,10 +719,17 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
continue;
MInfoColumn infoColumnAppend = (MInfoColumn) modelHasInfoColumn.getAD_InfoColumn();
//TODO: improve read data to get data by data type of column.
String appendData = null;
Object appendData = null;
try {
if (DisplayType.isID(infoColumnAppend.getAD_Reference_ID())) {
appendData = rs.getInt(infoColumnAppend.getColumnName());
} else if (DisplayType.isDate(infoColumnAppend.getAD_Reference_ID())) {
appendData = rs.getTimestamp(infoColumnAppend.getColumnName());
} else if (DisplayType.isNumeric(infoColumnAppend.getAD_Reference_ID())) {
appendData = rs.getBigDecimal(infoColumnAppend.getColumnName());
} else {
appendData = rs.getString(infoColumnAppend.getColumnName());
}
} catch (SQLException e) {
appendData = null;
}
@ -1406,7 +1414,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
if (keyColumValue instanceof Integer){
keyValue = (Integer)keyColumValue;
}else {
String msg = "column play keyView should is integer";
String msg = "keyView column must be integer";
AdempiereException ex = new AdempiereException (msg);
log.severe(msg);
throw ex;