From 2ca461397ff5142f858bac04ba6368edb7e817fd Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sun, 19 Nov 2023 12:16:03 +0100 Subject: [PATCH] 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 --- trytond/trytond/ir/model.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trytond/trytond/ir/model.py b/trytond/trytond/ir/model.py index c5294ac610..dab9ed0914 100644 --- a/trytond/trytond/ir/model.py +++ b/trytond/trytond/ir/model.py @@ -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)