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

View File

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