diff --git a/org.adempiere.base/src/org/compiere/process/ProcessInfo.java b/org.adempiere.base/src/org/compiere/process/ProcessInfo.java index 4215f6cdab..68e9d410ec 100644 --- a/org.adempiere.base/src/org/compiere/process/ProcessInfo.java +++ b/org.adempiere.base/src/org/compiere/process/ProcessInfo.java @@ -171,6 +171,9 @@ public class ProcessInfo implements Serializable private int m_AD_Scheduler_ID = 0; + /** For scheduler: true to notify scheduler recipients with process execution result using AD_Scheduler.R_MailTexT_ID mail template (if define). Default is true. **/ + private boolean isNotifyRecipients = true; + public int getLanguageID() { return languageID; } @@ -994,4 +997,17 @@ public class ProcessInfo implements Serializable this.m_AD_Scheduler_ID = AD_Scheduler_ID; } + /** + * @return true if scheduler should notify scheduler recipients with process execution result + */ + public boolean isNotifyRecipients() { + return isNotifyRecipients; + } + + /** + * @param isNotifyRecipients if true, scheduler should notify scheduler recipients with process execution result + */ + public void setNotifyRecipients(boolean isNotifyRecipients) { + this.isNotifyRecipients = isNotifyRecipients; + } } // ProcessInfo diff --git a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java index 338cc4a3af..d7f583ed61 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java @@ -269,9 +269,9 @@ public class Scheduler extends AdempiereServer } List sendErrors = new ArrayList<>(); - // always notify recipients + // notify recipients Integer[] userIDs = scheduler.getRecipientAD_User_IDs(true); - if (userIDs.length > 0) + if (userIDs.length > 0 && pi.isNotifyRecipients()) { ProcessInfoUtil.setLogFromDB(pi); List fileList = new ArrayList();