[FIX]Refixed the issue of color of process node, here we forget to check for gray, if gray not available then and then we will go to check for active.

bzr revid: msh@tinyerp.com-20120530090956-h0uxm1c2pm4xjwkl
This commit is contained in:
msh-openerp
2012-05-30 14:39:56 +05:30
2 changed files with 8 additions and 0 deletions
@@ -68,6 +68,7 @@
<field eval="&quot;&quot;&quot;Accounting&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accounting entries.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='posted'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
+7
View File
@@ -118,6 +118,7 @@ class process_process(osv.osv):
data['active'] = False
data['gray'] = False
data['url'] = node.help_url
data['model_states'] = node.model_states
# get assosiated workflow
if data['model']:
@@ -198,6 +199,12 @@ class process_process(osv.osv):
resource['name'] = refobj.name_get(context)[0][1]
resource['perm'] = pool.get(ref_model).perm_read(cr, uid, [ref_id], context)[0]
ref_expr_context = Env(refobj, current_user)
try:
if not nodes[nid]['gray']:
nodes[nid]['active'] = eval(nodes[nid]['model_states'], ref_expr_context)
except:
pass
for r in relatives:
node = nodes[r]
if 'res' not in node: