Revision: c3cafbc86d
Create Wiki Page
Restore Revision
@@ -0,0 +1,118 @@
+<p align="justify"> Using strideERP's workflows, you can change how certain processes/documents are approved.</p>
+
+
+<p align="justify"> Workflows using strideERP can be set up to have multiple levels of approval. strideERP requires you to fill out Workflow conditions if you want to allow multiple users to submit multiple requests for approval. StrideERP keeps track of multiple permissions before they are submitted. </p>
+
+
+<p align="justify"> For example, a leave application would have to go through multiple levels of approval. An employee would have to create the application first. Then it is either approved or rejected by his/her direct manager. If approved by the direct manager, it is further approved or rejected by the HR Manager.</p>
+
+<p><b>You can create workflows and transition rules by going to:</b></p>
+
+<p> Home > Settings > Workflow </p>
+
+<p align="justify"> After a Workflow is created, Workflow Actions can be used to perform actions</p>
+
+
+<h2> 1. Prerequisites </h2>
+<p align="justify"> Before creating a Workflow, it is recommended to create the following: </p>
+<ul>
+<li> Workflow Actions</li>
+<li> Workflow States like Approved, Canceled, etc.</li>
+</ul>
+
+
+<h2> 2. How to Create a Workflow </h2>
+<ol>
+<li> Go to the Workflow list, click on New. </li>
+<li>Fill out the Workflow name and choose the DocType on which it will be applied.</li>
+<li>Enter the various Workflow states. Fill out the Doc Status field</li>
+<li>Select the field that needs to be updated from the Update Field column then enter what the value should be updated to under Update Value.</li>
+
+<p align="justify"> The Workflow States might be colored differently depending on their state. For instance, success will have the color green. Saved = 0, Submitted = 1, and Cancelled = 2 are the document statuses. </p>
+
+<li> Enter the Transition Rules.</li>
+</ol>
+
+<h3> 2.2 What to consider when creating a workflow: </h3>
+<ul>
+<li>Workflows in strideERP essentially override the regular Save and Submit workflow. Therefore, the document will function according to your Workflow rather than based on the pre-set workflow code. So, if you don't specify it in the Workflow you create, there may not be a Submit button. </li>
+
+<li>A document with no workflow applied and which can be submitted will have a default workflow with states: Draft - Submitted - Cancelled. if you are implementing a workflow on a submittable document. Then those default states should be handled by the user</li>
+
+<li>Documents cannot be canceled until they are submitted.</li>
+
+<li>You will need to write a workflow transition step that lets users cancel after submitting.</li>
+
+<li>A customized field with the name specified in the 'Workflow State Field' will be created if the columns under "Update Field" aren't updated.</li>
+
+</ul>
+
+
+<h3> 2.3 Additional options for a Workflow </h3>
+<ul>
+<li><b>Is Active: </b>Once this checkbox is checked, it will turn off all other Workflows for the selected DocType.</li>
+<li><b>Don't Override Status:</b> The status of this workflow will not override the status of the document (Leave Application) in the list view.</li>
+<li><b>Send Email Alerts:</b> An email alert will be sent to the user with the next possible workflow action.</li>
+
+</ul>
+
+<h2> 3. Features </h2>
+
+<h3> 3.1 Send Email Alerts </h3>
+<p align="justify"> In Workflow Actions, the 'Send Email Alert' checkbox must be checked to send email notifications.</p>
+
+<p align="justify"> If If a user can take action on a workflow, they will receive an email with the relevant document attached. Once the user reviews the document, they can either approve or reject the workflow.</p>
+<img src="/files/Send Email Alerts.png">
+
+<h3> 3.2 Allow Super Approve </h3>
+<p align="justify"> If this checkbox is enabled, you can allow users with the role 'System Manager' to approve the document regardless of what current state of the workflow it is in. After enabling this feature you have to specify what state you want the Super Approve action take the document to, for example once a document has been Super approved it can go straight to the "Approved" state. </p>
+<p align="justify"> For example, if a user with HR manager role is on leave the system manager will be able to approve some stuck documents without having to giving him HR manager.</p>
+<img src="/files/Enable Supper Approve checkbox.png">
+
+<h3> 3.3 Enable/Disable Optional Workflow State </h3>
+
+<p align="justify"> Is Optional State: if this checkbox is enabled, it means that the state is not required for final approval.</p>
+
+<p align="justify"> For example, states such as Cancelled or Rejected can be optional.</p>
+
+<blockquote><b>Note:</b> No workflow actions are created for optional states. </blockquote>
+
+
+<h3> 3.4 Conditions </h3>
+
+<p align="justify">A condition can also be added to the Transition to make it applicable. When an employee requests a leave application for more than 30 days, then a specific role only can approve it. You may make this happen in a certain transition by setting a property for Condition: </p>
+
+<pre><code>doc.total_leavedays <>= 30 </code></pre>
+
+<p align="justify"> 'Currently Booked' is the field name of the field 'total_leavedays' of the Leave Application. To view the field name of a field go to Menu > Customize.</p>
+
+<p align="justify"> This can be extended to any property of the document.</p>
+
+<p align="justify"> In your condition expressions, you can use date/time, session, getvalue, and getlist.</p>
+
+<p align="justify"> <b> Functions that are allowed:</b></p>
+<ul>
+<li>frappe.db.get_value</li>
+<li>frappe.db.get_list</li>
+<li>frappe.session</li>
+<li>frappe.utils.now_datetime</li>
+<li>frappe.utils.get_datetime</li>
+<li>frappe.utils.addtodate</li>
+<li>frappe.utils.now</li>
+</ul>
+
+<p>Examples:</p>
+<pre><code>doc.creation > frappe.utils.add_to_date(frappe.utils.now_datetime(), days=-5, as_string=True, as_datetime=True) </code></pre>
+
+<h2> 4. Example of a Leave Application Process </h2>
+<p align="justify"> When a Leave Application is saved by an employee the status of the document changes to "Draft" and when clicked on "Send to Direct Manager" the status changes to 'Pending Direct Manager ':</p>
+<img src= "/files/Send to direct manager.png">
+
+<p align="justify"> When the Direct Manager receives the leave application, he/she can either Approve or Reject. If approved the status of the document changes to "Pending HR Manager".</p>
+
+<img src="/files/Approva:Rejection By Direct Manager.png">
+
+<p align="justify"> When the HR Manager opens the Leave Application, then he/she can finally "Approve" or "Reject" it.</p>
+
+<img src="/files/Approval:Rejection By HR Manager.png">
+