summaryrefslogtreecommitdiff
path: root/addons/process/process.py
diff options
context:
space:
mode:
authorXavier ALT <xal@openerp.com>2012-07-16 12:43:50 +0200
committerXavier ALT <xal@openerp.com>2012-07-16 12:43:50 +0200
commit2dd0485d4a14c1e3f64f8e40c9b91b166463eb4f (patch)
tree8c01b1210625ed1aa8ab37f5add39c8350c3403e /addons/process/process.py
parentd0125d893d75df7ba7be5a9d61a3e68051a42b7c (diff)
parent0d3bf8d1a21cae4d8bb70009fc34ad3520ca224c (diff)
[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
Diffstat (limited to 'addons/process/process.py')
-rw-r--r--addons/process/process.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/addons/process/process.py b/addons/process/process.py
index 524a3236e7b..464cf460616 100644
--- a/addons/process/process.py
+++ b/addons/process/process.py
@@ -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
-
- 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
+ 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: