From d4f5aabe647b7e3afb7466d8158ac9503c7fa97e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 27 Nov 2023 09:00:58 +0100 Subject: [PATCH] IDEMPIERE-5835 [Process Info] - Disallow Multiple Executions by different users (#2118) - assign the default programatically to cover old 2Packs having this value as NULL --- .../src/org/compiere/model/MProcess.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MProcess.java b/org.adempiere.base/src/org/compiere/model/MProcess.java index 7077155fba..fb45c5ccd9 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcess.java +++ b/org.adempiere.base/src/org/compiere/model/MProcess.java @@ -50,7 +50,12 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport /** * */ - private static final long serialVersionUID = 6928560924056836659L; + + /** + * + */ + private static final long serialVersionUID = -2068744950300991237L; + /** * Get MProcess from Cache (immutable) @@ -642,4 +647,16 @@ public class MProcess extends X_AD_Process implements ImmutablePOSupport return this; } + /** + * Called before Save for Pre-Save Operation + * @param newRecord new record + * @return true if record can be saved + */ + @Override + protected boolean beforeSave(boolean newRecord) { + if (getAllowMultipleExecution() == null) + setAllowMultipleExecution(ALLOWMULTIPLEEXECUTION_NotFromSameUserAndParameters); + return true; + } + } // MProcess