IDEMPIERE-1894 Missing SeqNoGrid when generating Fields in a Tab (TabCreateFields.java) / based on patch from Jan Thielemann

This commit is contained in:
Carlos Ruiz 2014-05-07 18:47:38 -05:00
parent 20a8fd221c
commit 9a1a4eb2ee
2 changed files with 12 additions and 2 deletions

View File

@ -92,7 +92,9 @@ public class TabCreateFields extends SvrProcess
PreparedStatement pstmt = null;
ResultSet rs = null;
int seqno = DB.getSQLValue(null, "SELECT MAX(SeqNo) FROM AD_Field WHERE AD_Tab_ID=?", tab.getAD_Tab_ID());
int seqnogrid = DB.getSQLValue(null, "SELECT MAX(SeqNoGrid) FROM AD_Field WHERE AD_Tab_ID=?", tab.getAD_Tab_ID());
seqno = seqno + 10;
seqnogrid = seqnogrid + 10;
try
{
pstmt = DB.prepareStatement (sql, get_TrxName());
@ -125,8 +127,6 @@ public class TabCreateFields extends SvrProcess
}
// Assign some default formatting
field.setSeqNo(seqno);
seqno = seqno + 10;
if (column.getAD_Reference_ID() == DisplayType.Button || column.getAD_Reference_ID() == DisplayType.YesNo) {
field.setXPosition(2);
}
@ -156,6 +156,15 @@ public class TabCreateFields extends SvrProcess
field.setIsDisplayedGrid(false);
}
}
if (field.isDisplayed()) {
field.setSeqNo(seqno);
seqno = seqno + 10;
}
if (field.isDisplayedGrid()) {
field.setSeqNoGrid(seqnogrid);
seqnogrid = seqnogrid + 10;
}
if (field.save())
{

View File

@ -51,6 +51,7 @@ public class MField extends X_AD_Field
setEntityType (ENTITYTYPE_UserMaintained); // U
setIsCentrallyMaintained (true); // Y
setIsDisplayed (true); // Y
setIsDisplayedGrid (true); // Y
setIsEncrypted (false);
setIsFieldOnly (false);
setIsHeading (false);