- 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