From c9ccea5533ab08aacce162c2b3e7ce4c2342e18c Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Wed, 7 Jun 2023 22:09:27 +0200 Subject: [PATCH] IDEMPIERE-5721: Fill AD_ZoomCondition.SeqNo (#1841) --- .../org/compiere/model/MZoomCondition.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MZoomCondition.java b/org.adempiere.base/src/org/compiere/model/MZoomCondition.java index 990a4114e4..2e1675fcd4 100644 --- a/org.adempiere.base/src/org/compiere/model/MZoomCondition.java +++ b/org.adempiere.base/src/org/compiere/model/MZoomCondition.java @@ -30,17 +30,18 @@ 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 * @param ctx Context * @param AD_ZoomCondition_UU UUID key @@ -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 \ No newline at end of file