Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
def get_workflow_states():
    workflow = get_workflow("Sales Order")
    states = partial(mapf, lambda x: x.state)
    return states(workflow.states)