Commit 242e91f6 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_configurator: get state infos according to transition's condition

parent 91b4277a
......@@ -8,19 +8,21 @@ previous_state_list = []
workflow = business_configuration.getResourceValue()
state = workflow.getSourceValue()
while state not in previous_state_list:
transition = state.getDestinationValue()
previous_state_list.append(state)
if transition is None:
break
state = transition.getDestinationValue()
if state is None:
break
if transition.getTransitionFormId() not in (None, ""):
result.append({'state' : state.getTitle(),
def getStateInfo(state):
if state in previous_state_list or state is None:
return
previous_state_list.append(state)
transition_list = state.getAvailableTransitionList(business_configuration)
for transition in transition_list:
state = transition.getDestinationValue()
if state and transition.getTransitionFormId() not in (None, ""):
result.append({'state' : state.getTitle(),
'description' : state.getDescription(),
'title': state.getTitle()})
getStateInfo(state)
getStateInfo(state)
return result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment