IDEMPIERE-4990 Inconsistent product attribute order (#912)

This commit is contained in:
Carlos Ruiz 2021-10-08 10:53:24 +02:00 committed by GitHub
parent 12c7c20c23
commit 21f022f2af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 10 deletions

View File

@ -46,7 +46,10 @@ public class WInfoPAttributeEditor extends WEditor implements IWhereClauseEditor
this.ctx = ctx;
this.windowNo = windowNo;
getComponent().addEventListener(Events.ON_CLICK, this);
getComponent().setImage(ThemeManager.getThemeResource("images/PAttribute16.png"));
if (ThemeManager.isUseFontIconForImage())
getComponent().setIconSclass("z-icon-PAttribute");
else
getComponent().setImage(ThemeManager.getThemeResource("images/PAttribute16.png"));
getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "PAttribute"));
setReadWrite(false);
}

View File

@ -232,18 +232,20 @@ public class InfoPAttributePanel extends Window implements EventListener<Event>
{
PreparedStatement pstmt = null;
ResultSet rs = null;
String whereAttributeSet;
String joinAttributeSet;
if (p_M_AttributeSet_ID > 0)
whereAttributeSet = "AND M_Attribute_ID IN (SELECT M_Attribute_ID FROM M_AttributeUse WHERE M_AttributeSet_ID="+p_M_AttributeSet_ID+")";
joinAttributeSet = "JOIN M_AttributeUse mau ON (a.M_Attribute_ID = mau.M_Attribute_ID AND mau.M_AttributeSet_ID="+p_M_AttributeSet_ID+")";
else
whereAttributeSet = "";
joinAttributeSet = "";
String sql = MRole.getDefault().addAccessSQL(
"SELECT M_Attribute_ID, Name, Description, AttributeValueType, IsInstanceAttribute "
+ "FROM M_Attribute "
+ "WHERE IsActive='Y' "
+ whereAttributeSet
+ " ORDER BY IsInstanceAttribute, Name",
"M_Attribute", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
"SELECT a.M_Attribute_ID, a.Name, a.Description, a.AttributeValueType, a.IsInstanceAttribute "
+ "FROM M_Attribute a "
+ joinAttributeSet
+ " WHERE a.IsActive='Y' "
+ " ORDER BY "
+ (p_M_AttributeSet_ID > 0 ? "mau.SeqNo, " : "")
+ "a.IsInstanceAttribute, a.Name",
"a", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
boolean instanceLine = false;
try
{