[FIX]Fixed the issue of process view, here condition must be given more priority then node state, but instead of it here the thing was reverse, node state has given more priority.

bzr revid: msh@tinyerp.com-20120529110705-5ggbxuytkeykr4cy
This commit is contained in:
msh-openerp
2012-05-29 16:37:05 +05:30
parent f0cc26e0cb
commit 0d3bf8d1a2
2 changed files with 15 additions and 15 deletions
+14 -14
View File
@@ -131,21 +131,21 @@ class process_process(osv.osv):
if node.menu_id:
data['menu'] = {'name': node.menu_id.complete_name, 'id': node.menu_id.id}
if node.model_id and node.model_id.model == res_model:
try:
data['active'] = eval(node.model_states, expr_context)
except Exception:
pass
try:
gray = True
for cond in node.condition_ids:
if cond.model_id and cond.model_id.model == res_model:
gray = gray and eval(cond.model_states, expr_context)
data['gray'] = not gray
except:
pass
if not data['active']:
try:
gray = True
for cond in node.condition_ids:
if cond.model_id and cond.model_id.model == res_model:
gray = gray and eval(cond.model_states, expr_context)
data['gray'] = not gray
except:
pass
if not data['gray']:
if node.model_id and node.model_id.model == res_model:
try:
data['active'] = eval(node.model_states, expr_context)
except Exception:
pass
nodes[node.id] = data
if node.flow_start:
+1 -1
View File
@@ -135,7 +135,7 @@
<record id="process_condition_conditionorigin" model="process.condition">
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="node_id" ref="process_node_draftpurchaseorder1"/>
<field eval="&quot;&quot;&quot;object.origin==''&quot;&quot;&quot;" name="model_states"/>
<field eval="&quot;&quot;&quot;object.origin==False&quot;&quot;&quot;" name="model_states"/>
<field eval="&quot;&quot;&quot;condition_origin&quot;&quot;&quot;" name="name"/>
</record>