IDEMPIERE-316 Inform when the user is not approver of a workflow doc / Peer review

This commit is contained in:
Carlos Ruiz 2012-11-09 13:11:09 -05:00
parent c407d6a3d0
commit 0dd0d36ad2
3 changed files with 31 additions and 5 deletions

View File

@ -0,0 +1,13 @@
-- Nov 9, 2012 12:22:47 PM COT
-- IDEMPIERE-316 Inform when the user is not approver of a workflow doc
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Cannot Approve - No Approver',200111,'D','56d07e7f-7414-4e55-9083-1818e0a6c4f9','NoApprover','Y',TO_DATE('2012-11-09 12:22:46','YYYY-MM-DD HH24:MI:SS'),0,0,0,0,TO_DATE('2012-11-09 12:22:46','YYYY-MM-DD HH24:MI:SS'))
;
-- Nov 9, 2012 12:22:47 PM COT
-- IDEMPIERE-316 Inform when the user is not approver of a workflow doc
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200111 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
SELECT register_migration_script('201211091228_IDEMPIERE-316.sql') FROM dual
;

View File

@ -0,0 +1,13 @@
-- Nov 9, 2012 12:22:47 PM COT
-- IDEMPIERE-316 Inform when the user is not approver of a workflow doc
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Cannot Approve - No Approver',200111,'D','56d07e7f-7414-4e55-9083-1818e0a6c4f9','NoApprover','Y',TO_TIMESTAMP('2012-11-09 12:22:46','YYYY-MM-DD HH24:MI:SS'),0,0,0,0,TO_TIMESTAMP('2012-11-09 12:22:46','YYYY-MM-DD HH24:MI:SS'))
;
-- Nov 9, 2012 12:22:47 PM COT
-- IDEMPIERE-316 Inform when the user is not approver of a workflow doc
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200111 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
SELECT register_migration_script('201211091228_IDEMPIERE-316.sql') FROM dual
;

View File

@ -663,7 +663,6 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
if (user.equals(oldUser)) if (user.equals(oldUser))
{ {
log.info("Loop - " + user.getName()); log.info("Loop - " + user.getName());
//return (Integer) null;
user=null; user=null;
break; break;
} }
@ -916,7 +915,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
if (processMsg == null || processMsg.length() == 0) if (processMsg == null || processMsg.length() == 0)
processMsg = e.getMessage(); processMsg = e.getMessage();
setTextMsg(processMsg); setTextMsg(processMsg);
addTextMsg(e); // addTextMsg(e); // do not add the exception text
setWFState (StateEngine.STATE_Terminated); // unlocks setWFState (StateEngine.STATE_Terminated); // unlocks
// Set Document Status // Set Document Status
if (m_po != null && m_po instanceof DocAction && m_docStatus != null) if (m_po != null && m_po instanceof DocAction && m_docStatus != null)
@ -1162,8 +1161,9 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
doc.getC_Currency_ID(), doc.getApprovalAmt(), doc.getC_Currency_ID(), doc.getApprovalAmt(),
doc.getAD_Org_ID(), doc.getAD_Org_ID(),
startAD_User_ID == doc.getDoc_User_ID()); // own doc startAD_User_ID == doc.getDoc_User_ID()); // own doc
if(nextAD_User_ID<=0){ if (nextAD_User_ID<=0) {
throw new AdempiereException("No exist approval user for this user or for this amount"); m_docStatus = DocAction.STATUS_Invalid;
throw new AdempiereException(Msg.getMsg(getCtx(), "NoApprover"));
} }
// same user = approved // same user = approved
autoApproval = startAD_User_ID == nextAD_User_ID; autoApproval = startAD_User_ID == nextAD_User_ID;
@ -1351,7 +1351,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
if (nextAD_User_ID <= 0) if (nextAD_User_ID <= 0)
{ {
newState = StateEngine.STATE_Aborted; newState = StateEngine.STATE_Aborted;
setTextMsg ("Cannot Approve - No Approver"); setTextMsg (Msg.getMsg(getCtx(), "NoApprover"));
doc.processIt (DocAction.ACTION_Reject); doc.processIt (DocAction.ACTION_Reject);
} }
else if (startAD_User_ID != nextAD_User_ID) else if (startAD_User_ID != nextAD_User_ID)