check if workflow_state_name already exists

This commit is contained in:
Shreya 2018-01-24 14:53:06 +05:30
parent a309a871b5
commit a8a952deff

View File

@ -8,6 +8,7 @@ def execute():
frappe.reload_doc("hr", "doctype", "leave_application")
frappe.reload_doc("workflow", "doctype", "workflow")
if not frappe.db.exists("Workflow State", "Open"):
frappe.get_doc({
'doctype': 'Workflow State',
'workflow_state_name': 'Open',