~openerp-dev/openobject-server/trunk-missing-default-values-pza

« back to all changes in this revision

Viewing changes to openerp/addons/base/workflow/workflow_report.py

  • Committer: Pooja Zankhariya (OpenERP)
  • Date: 2014-01-31 06:44:29 UTC
  • mfrom: (5013.1.35 trunk)
  • Revision ID: pza@tinyerp.com-20140131064429-0a1u9ax5cf3sslug
[MERGE]Sync with Trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
_logger = logging.getLogger(__name__)
28
28
 
29
 
def graph_get(cr, graph, wkf_ids, nested, workitem, processed_subflows):
 
29
def graph_get(cr, graph, wkf_ids, nested, workitem, witm_trans, processed_subflows):
30
30
    import pydot
31
31
    cr.execute('select * from wkf_activity where wkf_id in ('+','.join(['%s']*len(wkf_ids))+')', wkf_ids)
32
32
    nodes = cr.dictfetchall()
40
40
            cr.execute('select * from wkf where id=%s', (n['subflow_id'],))
41
41
            wkfinfo = cr.dictfetchone()
42
42
            graph2 = pydot.Cluster('subflow'+str(n['subflow_id']), fontsize='12', label = "\"Subflow: %s\\nOSV: %s\"" % ( n['name'], wkfinfo['osv']) )
43
 
            (s1,s2) = graph_get(cr, graph2, [n['subflow_id']], True, workitem, processed_subflows)
 
43
            (s1,s2) = graph_get(cr, graph2, [n['subflow_id']], True, workitem, witm_trans, processed_subflows)
44
44
            graph.add_subgraph(graph2)
45
45
            actfrom[n['id']] = s2
46
46
            actto[n['id']] = s1
89
89
            args['arrowtail']='inv'
90
90
 
91
91
        if activities[t['act_to']]['join_mode']=='AND':
92
 
            args['arrowhead']='crow'
 
92
            args['arrowhead']='crow' 
 
93
        if t['id'] in witm_trans:
 
94
            args['color'] = 'red'
93
95
 
94
96
        activity_from = actfrom[t['act_from']][1].get(t['signal'], actfrom[t['act_from']][0])
95
97
        activity_to = actto[t['act_to']][1].get(t['signal'], actto[t['act_to']][0])
119
121
            workitems.update(workitem_get(subflow_id))
120
122
        return workitems
121
123
 
 
124
    def witm_get(instance):
 
125
        cr.execute("select trans_id from wkf_witm_trans where inst_id=%s", (instance,))
 
126
        return set(t[0] for t in cr.fetchall())
 
127
 
122
128
    processed_subflows = set()
123
 
    graph_get(cr, graph, [x[0] for x in inst], nested, workitem_get(inst_id), processed_subflows)
 
129
    graph_get(cr, graph, [x[0] for x in inst], nested, workitem_get(inst_id), witm_get(inst_id), processed_subflows)
124
130
 
125
131
#
126
132
# TODO: pas clean: concurrent !!!