IDEMPIERE-1177 Record Info not showing UUID for zero ID records
This commit is contained in:
parent
8466e356d3
commit
9332613bf1
|
@ -263,12 +263,37 @@ public class WRecordInfo extends Window implements EventListener<Event>
|
||||||
if (firstField != null && firstField.getGridTab() != null)
|
if (firstField != null && firstField.getGridTab() != null)
|
||||||
tabName = firstField.getGridTab().getName();
|
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())
|
if (gridTable != null && dse.getCurrentRow() >= 0 && dse.getCurrentRow() < gridTable.getRowCount())
|
||||||
{
|
{
|
||||||
PO po = gridTable.getPO(dse.getCurrentRow());
|
PO po = gridTable.getPO(dse.getCurrentRow());
|
||||||
if (po != null) {
|
if (po != null) {
|
||||||
String uuidcol = po.getUUIDColumnName();
|
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))
|
if (!Util.isEmpty(uuid))
|
||||||
m_info.append("\n ").append(uuidcol).append("=").append(uuid);
|
m_info.append("\n ").append(uuidcol).append("=").append(uuid);
|
||||||
m_permalink.setHref(AEnv.getZoomUrlTableID(po));
|
m_permalink.setHref(AEnv.getZoomUrlTableID(po));
|
||||||
|
@ -279,8 +304,7 @@ public class WRecordInfo extends Window implements EventListener<Event>
|
||||||
// Title
|
// Title
|
||||||
if (tabName == null && dse.AD_Table_ID != 0)
|
if (tabName == null && dse.AD_Table_ID != 0)
|
||||||
{
|
{
|
||||||
MTable table1 = MTable.get (Env.getCtx(), dse.AD_Table_ID);
|
tabName = dbtable.getName();
|
||||||
tabName = table1.getName();
|
|
||||||
}
|
}
|
||||||
setTitle(title + " - " + tabName);
|
setTitle(title + " - " + tabName);
|
||||||
|
|
||||||
|
@ -288,12 +312,7 @@ public class WRecordInfo extends Window implements EventListener<Event>
|
||||||
if (!MRole.PREFERENCETYPE_Client.equals(MRole.getDefault().getPreferenceType()))
|
if (!MRole.PREFERENCETYPE_Client.equals(MRole.getDefault().getPreferenceType()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int Record_ID = 0;
|
if (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)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
|
|
Loading…
Reference in New Issue