process graph_get returns more info.
authorAmit Mendapara <ame@tinyerp.com>
Fri, 12 Sep 2008 14:03:31 +0000 (19:33 +0530)
committerAmit Mendapara <ame@tinyerp.com>
Fri, 12 Sep 2008 14:03:31 +0000 (19:33 +0530)
bzr revid: ame@tinyerp.com-20080912140331-chp9afy88vywsxyd

addons/process/process.py

index 0b08c2e..cff0a1f 100644 (file)
@@ -74,6 +74,18 @@ class process_process(osv.osv):
                 data['source'] = tr.node_from_id.id
                 data['target'] = tr.node_to_id.id
 
+                data['buttons'] = buttons = []
+                for b in tr.action_ids:
+                    button = {}
+                    button['name'] = b.name
+                    buttons.append(button)
+
+                data['roles'] = roles = []
+                for r in tr.transition_ids:
+                    role = {}
+                    role['name'] = r.role_id.name
+                    roles.append(role)
+
                 transitions[tr.id] = data
 
         g = tools.graph(nodes.keys(), map(lambda x: (x['source'], x['target']), transitions.values()))