Make state node of workflow graph unique
Quite a few model have states with the same name (e.g. "open", "close). When creating Workflow Graphs for several of these models at once, the nodes of these states must be distinguished. Otherwise the graphs will overlap and eventually even overwrite each other. Closes #12253 (grafted from 91a09102ec61a08f57868bc9f030fdcb9ab831c8) --HG-- branch : 6.0
This commit is contained in:
1 parent
c5d2e432cd
commit
2ca461397f
1 file changed
+5
-3
@@ -1537,10 +1537,12 @@ class ModelWorkflowGraph(Report):
|
||||
state_field = getattr(Model, Model._transition_state)
|
||||
for state, _ in state_field.selection:
|
||||
node = pydot.Node(
|
||||
'"%s"' % state, shape='octagon', label=state)
|
||||
f'"{record.model}--{state}"', shape='octagon', label=state)
|
||||
subgraph.add_node(node)
|
||||
|
||||
for from_, to in Model._transitions:
|
||||
edge = pydot.Edge('"%s"' % from_, '"%s"' % to,
|
||||
arrowhead='normal')
|
||||
edge = pydot.Edge(
|
||||
f'"{record.model}--{from_}"',
|
||||
f'"{record.model}--{to}"',
|
||||
arrowhead='normal')
|
||||
subgraph.add_edge(edge)
|
||||
Reference in new issue
Block a user