IDEMPIERE-3285 Empty string Attribute Sets filled with numbers

This commit is contained in:
Carlos Ruiz 2017-01-17 00:18:38 +01:00
parent 76424a05fb
commit ad7b5180b5
2 changed files with 20 additions and 11 deletions

View File

@ -227,11 +227,14 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance
for (int i = 0; i < attributes.length; i++)
{
MAttributeInstance mai = attributes[i].getMAttributeInstance(getM_AttributeSetInstance_ID());
if (mai != null && mai.getValue() != null)
if (mai != null)
{
if (sb.length() > 0)
sb.append("_");
sb.append(mai.getValue());
if (mai.getValue() != null)
sb.append(mai.getValue());
else
sb.append("");
}
}
setDescription (sb.toString());

View File

@ -2762,16 +2762,22 @@ public abstract class PO
set_ValueNoCheck(columnName, value);
}
}
// Set empty Value
columnName = "Value";
index = p_info.getColumnIndex(columnName);
if (index != -1)
{
String value = (String)get_Value(index);
if (value == null || value.length() == 0)
// ticket 1007459 - exclude M_AttributeInstance from filling Value column
if (! MAttributeInstance.Table_Name.equals(get_TableName())) {
// Set empty Value
columnName = "Value";
index = p_info.getColumnIndex(columnName);
if (index != -1)
{
value = DB.getDocumentNo (getAD_Client_ID(), p_info.getTableName(), m_trxName, this);
set_ValueNoCheck(columnName, value);
if (!p_info.isVirtualColumn(index))
{
String value = (String)get_Value(index);
if (value == null || value.length() == 0)
{
value = DB.getDocumentNo (getAD_Client_ID(), p_info.getTableName(), m_trxName, this);
set_ValueNoCheck(columnName, value);
}
}
}
}