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++) for (int i = 0; i < attributes.length; i++)
{ {
MAttributeInstance mai = attributes[i].getMAttributeInstance(getM_AttributeSetInstance_ID()); MAttributeInstance mai = attributes[i].getMAttributeInstance(getM_AttributeSetInstance_ID());
if (mai != null && mai.getValue() != null) if (mai != null)
{ {
if (sb.length() > 0) if (sb.length() > 0)
sb.append("_"); sb.append("_");
sb.append(mai.getValue()); if (mai.getValue() != null)
sb.append(mai.getValue());
else
sb.append("");
} }
} }
setDescription (sb.toString()); setDescription (sb.toString());

View File

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