IDEMPIERE-5721: Fill AD_ZoomCondition.SeqNo (#1841)

This commit is contained in:
Nicolas Micoud 2023-06-07 22:09:27 +02:00 committed by GitHub
parent 0cd091a91b
commit c9ccea5533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 5 deletions

View File

@ -30,15 +30,16 @@ import org.idempiere.cache.ImmutablePOSupport;
/**
* Zoom Condition model
*
* @author Nico
* @author Nicolas Micoud - TGI
* @version $Id: MZoomCondition.java
*/
public class MZoomCondition extends X_AD_ZoomCondition implements ImmutablePOSupport
{
/**
*
*/
private static final long serialVersionUID = -2472970418557589702L;
private static final long serialVersionUID = 381986049328113973L;
/**
* UUID based Constructor
@ -404,4 +405,16 @@ public class MZoomCondition extends X_AD_ZoomCondition implements ImmutablePOSup
return this;
}
/**
* Before Save
* @param newRecord
* @return true if ok
*/
protected boolean beforeSave (boolean newRecord) {
if (getSeqNo() == 0)
setSeqNo(DB.getSQLValueEx(get_TrxName(), "SELECT COALESCE(MAX(SeqNo), 0) + 10 FROM AD_ZoomCondition WHERE AD_Table_ID = ?", getAD_Table_ID()));
return true;
}
} // MZoomCondition