Add an approval workflow to a master
Workflows usually run on documents that you submit. Masters such as Item, Item Price, and Pricing Rule cannot be submitted. A workflow on a master can still show "Rejected", but users can still use the master in transactions.
To block an unapproved master, combine the workflow with the master's Disabled (or Enabled) checkbox. This page uses the Item master as the example.
Prerequisites
- The System Manager role.
- A Disabled or Enabled checkbox on the master. Item has Disabled. If the master has no such field, add a check field in Customize Form.
Step 1: Disable new records by default
- Open Customize Form, and select Item.
- Open the row of the Disabled field.
- Set Default to
1. For an Enabled field, set it to0. - Select Update.
Every new Item is now disabled until it is approved.
Step 2: Enable the record on approval
- Create a workflow for Item.
- In the Document States table, open the row of the Approved state.
- Set Update Field to Disabled and Update Value to
0. For an Enabled field, set it to1. - Save the workflow.
When an approver approves an Item, ERPNext clears Disabled. The Item is then available in transactions.