BASE: improve workflow print
bzr revid: ced-eb344920b1c45771eefb0df7f8b4e7865be86997
This commit is contained in:
parent
bbed964d48
commit
56a44f3bf5
|
@ -44,7 +44,7 @@ def graph_get(cr, graph, wkf_id, nested=False, workitem={}):
|
|||
if n['subflow_id'] and nested:
|
||||
cr.execute('select * from wkf where id=%d', (n['subflow_id'],))
|
||||
wkfinfo = cr.dictfetchone()
|
||||
graph2 = pydot.Cluster('subflow'+str(n['subflow_id']), fontsize=10, label = "Subflow: "+n['name']+'\\nOSV: '+wkfinfo['osv'])
|
||||
graph2 = pydot.Cluster('subflow'+str(n['subflow_id']), fontsize=12, label = "Subflow: "+n['name']+'\\nOSV: '+wkfinfo['osv'])
|
||||
(s1,s2) = graph_get(cr, graph2, n['subflow_id'], nested,workitem)
|
||||
graph.add_subgraph(graph2)
|
||||
actfrom[n['id']] = s2
|
||||
|
@ -82,7 +82,7 @@ def graph_get(cr, graph, wkf_id, nested=False, workitem={}):
|
|||
|
||||
activity_from = actfrom[t['act_from']][1].get(t['signal'], actfrom[t['act_from']][0])
|
||||
activity_to = actto[t['act_to']][1].get(t['signal'], actto[t['act_to']][0])
|
||||
graph.add_edge(pydot.Edge( activity_from ,activity_to, fontsize=8, **args))
|
||||
graph.add_edge(pydot.Edge( activity_from ,activity_to, fontsize=10, **args))
|
||||
nodes = cr.dictfetchall()
|
||||
cr.execute('select id from wkf_activity where flow_start=True and wkf_id=%d limit 1', (wkf_id,))
|
||||
start = cr.fetchone()[0]
|
||||
|
@ -128,6 +128,11 @@ class report_graph_instance(object):
|
|||
inst_id = cr.fetchone()[0]
|
||||
|
||||
graph = pydot.Dot(fontsize=16, label="\\n\\nWorkflow: %s\\n OSV: %s" % (wkfinfo['name'],wkfinfo['osv']))
|
||||
graph.set('size', '10.7,7.3')
|
||||
graph.set('center', '1')
|
||||
graph.set('ratio', 'auto')
|
||||
graph.set('rotate', '90')
|
||||
graph.set('rankdir', 'LR')
|
||||
graph_instance_get(cr, graph, inst_id, data.get('nested', False))
|
||||
ps_string = graph.create_ps(prog='dot')
|
||||
except:
|
||||
|
@ -138,7 +143,7 @@ class report_graph_instance(object):
|
|||
1.5 inch 15 inch moveto
|
||||
(No workflow available) show
|
||||
showpage'''
|
||||
input, output = os.popen2('ps2pdf -sPAPERSIZE=a3 - -')
|
||||
input, output = os.popen2('ps2pdf -sPAPERSIZE=a4 - -')
|
||||
input.write(ps_string)
|
||||
input.close()
|
||||
self.result = output.read()
|
||||
|
|
Loading…
Reference in New Issue