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("_");
if (mai.getValue() != null)
sb.append(mai.getValue()); sb.append(mai.getValue());
else
sb.append("");
} }
} }
setDescription (sb.toString()); setDescription (sb.toString());

View File

@ -2762,10 +2762,14 @@ public abstract class PO
set_ValueNoCheck(columnName, value); set_ValueNoCheck(columnName, value);
} }
} }
// ticket 1007459 - exclude M_AttributeInstance from filling Value column
if (! MAttributeInstance.Table_Name.equals(get_TableName())) {
// Set empty Value // Set empty Value
columnName = "Value"; columnName = "Value";
index = p_info.getColumnIndex(columnName); index = p_info.getColumnIndex(columnName);
if (index != -1) if (index != -1)
{
if (!p_info.isVirtualColumn(index))
{ {
String value = (String)get_Value(index); String value = (String)get_Value(index);
if (value == null || value.length() == 0) if (value == null || value.length() == 0)
@ -2774,6 +2778,8 @@ public abstract class PO
set_ValueNoCheck(columnName, value); set_ValueNoCheck(columnName, value);
} }
} }
}
}
boolean ok = doInsert(isLogSQLScript()); boolean ok = doInsert(isLogSQLScript());
return saveFinish (true, ok); return saveFinish (true, ok);