def get_next_workflow_actions(state): try: workflow = get_workflow("Sales Order") nexts = compose( partial(mapf, lambda x: x.action), partial(filter, lambda x: x.state == state), ) return nexts(workflow.transitions) except frappe.exceptions.DoesNotExistError: frappe.throw(NO_WORKFLOW_MSG)
def get_next_workflow_actions(state): workflow = get_workflow("Sales Order") nexts = compose(partial(mapf, lambda x: x.action), partial(filter, lambda x: x.state == state)) return nexts(workflow.transitions)
def get_workflow_states(): try: workflow = get_workflow("Sales Order") return [x.state for x in workflow.states] except frappe.exceptions.DoesNotExistError: frappe.throw(NO_WORKFLOW_MSG)
def get_workflow_states(): workflow = get_workflow("Sales Order") states = partial(mapf, lambda x: x.state) return states(workflow.states)