I’m encountering an issue with the workflow in ERPNext, where during the approval process of a document, workflow actions are not being recorded for users in between the creator and the final approver in the Workflow Action document. Specifically, only the creator and final approver’s actions are showing up in the “Workflow Action” list, even though the workflow state transitions for other users involved in the approval process.
note: all workflow states are not optional which are mentioned in erpnext documentation here in this link * Workflow Actions will not be created for a transition to optional states.
Step 1: Define Your Approval States
Since you have 5 states of approval, you need to define what these states are and how they relate to the users involved in the approval process. For example:
- Draft (Creator)
- Manager Approval
- Finance Approval
- Director Approval
- Final Approved
Step 2: Custom Fields for Tracking Approvals
You can add custom fields to your Doctype to track the approval status for each state. For example:
manager_approved
(Boolean)
finance_approved
(Boolean)
director_approved
(Boolean)
final_approved
(Boolean)
Step 3: Update Workflow Actions
When a document is submitted for approval, you can update these fields based on the actions taken by the users. You can use Frappe’s hooks to trigger functions when a document is submitted or approved.
1 Like