IDEMPIERE-1177 Record Info not showing UUID for zero ID records

This commit is contained in:
Carlos Ruiz 2018-07-11 17:19:37 +02:00
parent 8466e356d3
commit 9332613bf1
1 changed files with 28 additions and 9 deletions

View File

@ -263,12 +263,37 @@ public class WRecordInfo extends Window implements EventListener<Event>
if (firstField != null && firstField.getGridTab() != null)
tabName = firstField.getGridTab().getName();
}
int Record_ID = -1;
if (dse.Record_ID instanceof Integer)
Record_ID = ((Integer)dse.Record_ID).intValue();
else
log.info("dynInit - Invalid Record_ID=" + dse.Record_ID);
MTable dbtable = null;
if (dse.AD_Table_ID != 0)
dbtable = MTable.get(Env.getCtx(), dse.AD_Table_ID);
if (gridTable != null && dse.getCurrentRow() >= 0 && dse.getCurrentRow() < gridTable.getRowCount())
{
PO po = gridTable.getPO(dse.getCurrentRow());
if (po != null) {
String uuidcol = po.getUUIDColumnName();
String uuid = po.get_ValueAsString(uuidcol);
String uuid = null;
if (po.is_new()) {
if (Record_ID == 0 && MTable.isZeroIDTable(dbtable.getTableName())) {
StringBuilder sql = new StringBuilder("SELECT ")
.append(uuidcol)
.append(" FROM ")
.append(dbtable.getTableName())
.append(" WHERE ")
.append(dbtable.getTableName())
.append("_ID=0");
uuid = DB.getSQLValueString(null, sql.toString());
}
} else {
uuid = po.get_ValueAsString(uuidcol);
}
if (!Util.isEmpty(uuid))
m_info.append("\n ").append(uuidcol).append("=").append(uuid);
m_permalink.setHref(AEnv.getZoomUrlTableID(po));
@ -279,8 +304,7 @@ public class WRecordInfo extends Window implements EventListener<Event>
// Title
if (tabName == null && dse.AD_Table_ID != 0)
{
MTable table1 = MTable.get (Env.getCtx(), dse.AD_Table_ID);
tabName = table1.getName();
tabName = dbtable.getName();
}
setTitle(title + " - " + tabName);
@ -288,12 +312,7 @@ public class WRecordInfo extends Window implements EventListener<Event>
if (!MRole.PREFERENCETYPE_Client.equals(MRole.getDefault().getPreferenceType()))
return false;
int Record_ID = 0;
if (dse.Record_ID instanceof Integer)
Record_ID = ((Integer)dse.Record_ID).intValue();
else
log.info("dynInit - Invalid Record_ID=" + dse.Record_ID);
if (Record_ID == 0)
if (Record_ID <= 0)
return false;
// Data