Workflow: Reject to Cancelled as the First Option

300 views
Skip to first unread message

Javier

unread,
Aug 5, 2014, 2:14:03 AM8/5/14
to erpnext-u...@googlegroups.com
Dear All,

I would like to have a simple workflow that activates once the document is saved. E.g. Material Request is firstly Saved, then it will prompt 2 options (1) Approve (2) Reject. If Approve is selected, the document status should be Submitted, if Reject is selected, the document status should be Cancelled. 

I can get the Approval portion to work. The Rejection portion however does not move the document status to Cancelled. I read comments that you cannot move document status from Saved to Rejection. If this is the case, how do you handle simple approvals like this? Do you plainly leave document status as Saved if it is rejected?

Thank you.


Javier



Sunil Kumar

unread,
Aug 5, 2014, 2:40:15 AM8/5/14
to erpnext-u...@googlegroups.com

Javier

unread,
Aug 5, 2014, 4:32:36 AM8/5/14
to erpnext-u...@googlegroups.com
Dear Sunil,

Thanks for the reply. I had previously read all those posts and watched the video. Perhaps it was not written clearly in my previous post. But I am wondering, if I simply just want and Approve / Reject action, where Approve pushes the document to Submitted status and the Reject pushes the document to Cancelled status. Is this possible? 

If you look at the Youtube video, there is a State (Item 4) "Rejected --> 2 --> status --> Rejected --> Leave Approver". This state will never occur for Doc Status 2 when the document is in the "Applied" state and when the manager selects the Reject action (Transition Rule 2). I have personally tried this setup and it does not work. Unless there is something that I am missing here?

If I am at all completely wrong, how do you handle documents that need to be Rejected up front?

Thanks very much once again.


Javier

Rushabh Mehta

unread,
Aug 5, 2014, 4:40:32 AM8/5/14
to erpnext-u...@googlegroups.com


Dear Sunil,

Thanks for the reply. I had previously read all those posts and watched the video. Perhaps it was not written clearly in my previous post. But I am wondering, if I simply just want and Approve / Reject action, where Approve pushes the document to Submitted status and the Reject pushes the document to Cancelled status. Is this possible? 

Yeah should be easily possible. Did you give it a try (?)


If you look at the Youtube video, there is a State (Item 4) "Rejected --> 2 --> status --> Rejected --> Leave Approver". This state will never occur for Doc Status 2 when the document is in the "Applied" state and when the manager selects the Reject action (Transition Rule 2). I have personally tried this setup and it does not work. Unless there is something that I am missing here?

If I am at all completely wrong, how do you handle documents that need to be Rejected up front?

Thanks very much once again.


Javier

On Tuesday, August 5, 2014 2:40:15 PM UTC+8, Sunil Kumar wrote:
Hi Javier,

Just to refer existing discussion and resources we have for your query:


----
Sunil
Partner for ERPNext


On Tuesday, August 5, 2014 11:44:03 AM UTC+5:30, Javier wrote:
Dear All,

I would like to have a simple workflow that activates once the document is saved. E.g. Material Request is firstly Saved, then it will prompt 2 options (1) Approve (2) Reject. If Approve is selected, the document status should be Submitted, if Reject is selected, the document status should be Cancelled. 

I can get the Approval portion to work. The Rejection portion however does not move the document status to Cancelled. I read comments that you cannot move document status from Saved to Rejection. If this is the case, how do you handle simple approvals like this? Do you plainly leave document status as Saved if it is rejected?

Thank you.


Javier




--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/a248e831-947b-48be-aa8b-63ea722e056b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Javier

unread,
Aug 5, 2014, 7:23:45 AM8/5/14
to erpnext-u...@googlegroups.com
Yes I did, it didnt work. If Current Document Status is 0 - Saved there is no way to move it to 2-Cancelled.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

Anand Doshi

unread,
Aug 5, 2014, 7:44:31 AM8/5/14
to ERPNext User's Forum
Hi Javier,

In ERPNext, Submitted implies a freezed document, whereas Cancelled implies that a freezed document was Incorrect and has been Cancelled, until further modified using Amend.

I would recommend that you setup a Material Request workflow like:
  1. Create a custom field called "Approval Status" of type Select and with 2 possible values: Approved, Rejected
  2. All Material Requests should be submitted for Approval --> status = "Submitted", docstatus = 1
  3. Approve --> Approval Status = Approved, status = "Submitted", docstatus = 1
  4. Reject --> Approval Status = Rejected, status = "Cancelled", docstatus = 1
  5. Ask users to check for "Approval Status" for further processing.

I think this would work for you.

Thanks,
Anand.



To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/a4e6696c-7ac0-4ddd-b576-7aa51ab28fe1%40googlegroups.com.

Javier

unread,
Aug 12, 2014, 2:03:07 AM8/12/14
to erpnext-u...@googlegroups.com
Dear Anand,

The only problem is say for step no. 2 (e.g. for a Sales Order), before the document is "Approved" the document is already in status = "Submitted", docstatus =1, which means that the user is able to create invoices based on the Sales Order because within ERPNext the docstatus = 1. 

Is there anyway to stop this from happening? I.e. stop the user from creating an invoice without an Approved Sales Order?

Thank you.


Javier
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

wa...@xavierltd.com

unread,
Aug 12, 2014, 3:15:42 AM8/12/14
to erpnext-u...@googlegroups.com
‎Hi All,

Trust everyone's doing great. I also think this needs to be looked into. I've run into similar issues while developing workflows for docs like leave applications and expense claims. It's not enough to 'tell' users not to continue the process based on the value of a field; the system should restrict them from doing so. 

At the end of the day, we're forced to leave a long trail of documents in the saved status upon rejection. It would be great to have a simple solution like having the doc cancelled upon rejection (without submitting first) just like Javier was asking. ‎Alternatives might be ability to Submit and then Cancel with one click or have another doc status that functions similar to the cancelled status. 

Whatever the approach, I think there's a bit of tidying up to do here. 

As always, thanks for the great work guys!


Kind regards,
Olawale ‎
From: Javier
Sent: Tuesday, August 12, 2014 7:03 AM
Subject: Re: [erpnext-user-forum] Re: Workflow: Reject to Cancelled as the First Option

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/81c004df-c890-47c9-a71c-4b8332fa1fad%40googlegroups.com.

Rushabh Mehta

unread,
Aug 12, 2014, 3:36:42 AM8/12/14
to erpnext-u...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages