[MERGE] OPW 575178: process: node conditions have priority over model states (v6.0 forward-port)
- process node conditions defined which nodes can be reached in the current
context, so nodes which doesn't fullfill the conditions should stay gray
even if ``model_states`` eval to True.
bzr revid: xal@openerp.com-20120716104350-0144rsnxj5h0zcs1
This commit is contained in:
+14
-14
@@ -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:
|
||||
|
||||
@@ -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=""""object.origin==''"""" name="model_states"/>
|
||||
<field eval=""""not object.origin"""" name="model_states"/>
|
||||
<field eval=""""condition_origin"""" name="name"/>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user