290 lines
No EOL
7.2 KiB
HTML
290 lines
No EOL
7.2 KiB
HTML
<!-- title: Workflow -->
|
|
|
|
|
|
|
|
|
|
|
|
<div class="dev-header">
|
|
|
|
<a class="btn btn-default btn-sm" disabled style="margin-bottom: 10px;">
|
|
Version 6.10.1</a>
|
|
|
|
|
|
<a class="btn btn-default btn-sm" href="https://github.com/frappe/frappe/tree/develop/frappe/workflow/doctype/workflow"
|
|
target="_blank" style="margin-left: 10px; margin-bottom: 10px;"><i class="octicon octicon-mark-github"></i> Source</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p><b>Table Name:</b> <code>tabWorkflow</code></p>
|
|
|
|
|
|
Defines workflow states and rules for a document.
|
|
|
|
<h3>Fields</h3>
|
|
|
|
<table class="table table-bordered" style="table-layout: fixed;">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 5%">Sr</th>
|
|
<th style="width: 25%">Fieldname</th>
|
|
<th style="width: 20%">Type</th>
|
|
<th style="width: 25%">Label</th>
|
|
<th style="width: 25%">Options</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr >
|
|
<td>1</td>
|
|
<td class="danger" title="Mandatory"><code>workflow_name</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Workflow Name
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>2</td>
|
|
<td class="danger" title="Mandatory"><code>document_type</code></td>
|
|
<td >
|
|
Link</td>
|
|
<td >
|
|
Document Type
|
|
<p class="text-muted small">
|
|
DocType on which this Workflow is applicable.</p>
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/core/doctype">DocType</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>3</td>
|
|
<td ><code>is_active</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Is Active
|
|
<p class="text-muted small">
|
|
If checked, all other workflows become inactive.</p>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr class="info">
|
|
<td>4</td>
|
|
<td ><code>states_head</code></td>
|
|
<td >
|
|
Section Break</td>
|
|
<td >
|
|
States
|
|
<p class="text-muted small">
|
|
Different "States" this document can exist in. Like "Open", "Pending Approval" etc.</p>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>5</td>
|
|
<td class="danger" title="Mandatory"><code>states</code></td>
|
|
<td >
|
|
Table</td>
|
|
<td >
|
|
Document States
|
|
<p class="text-muted small">
|
|
All possible Workflow States and roles of the workflow.
|
|
Docstatus Options: 0 is"Saved", 1 is "Submitted" and 2 is "Cancelled"</p>
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/workflow/workflow_document_state">Workflow Document State</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="info">
|
|
<td>6</td>
|
|
<td ><code>transition_rules</code></td>
|
|
<td >
|
|
Section Break</td>
|
|
<td >
|
|
Transition Rules
|
|
<p class="text-muted small">
|
|
Rules for how states are transitions, like next state and which role is allowed to change state etc.</p>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>7</td>
|
|
<td class="danger" title="Mandatory"><code>transitions</code></td>
|
|
<td >
|
|
Table</td>
|
|
<td >
|
|
Transitions
|
|
<p class="text-muted small">
|
|
Rules defining transition of state in the workflow.</p>
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/workflow/workflow_transition">Workflow Transition</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>8</td>
|
|
<td ><code>workflow_state_field</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Workflow State Field
|
|
<p class="text-muted small">
|
|
Field that represents the Workflow State of the transaction (if field is not present, a new hidden Custom Field will be created)</p>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<hr>
|
|
<h3>Controller</h3>
|
|
<h4>frappe.workflow.doctype.workflow.workflow</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>Workflow</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.model.document.Document</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="create_custom_field_for_workflow_state" href="#create_custom_field_for_workflow_state" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>create_custom_field_for_workflow_state</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="on_update" href="#on_update" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>on_update</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="set_active" href="#set_active" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>set_active</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="update_default_workflow_status" href="#update_default_workflow_status" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>update_default_workflow_status</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="validate" href="#validate" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>validate</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="validate_docstatus" href="#validate_docstatus" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>validate_docstatus</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- autodoc -->
|
|
<!-- jinja -->
|
|
<!-- static --> |