From: msh-openerp Date: Tue, 29 May 2012 11:07:05 +0000 (+0530) Subject: [FIX]Fixed the issue of process view, here condition must be given more priority... X-Git-Tag: 7.0-server~308^2~4^2~12^2 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=0d3bf8d1a21cae4d8bb70009fc34ad3520ca224c;hp=f0cc26e0cb18a4f85696695e1519751093f9f914;p=odoo%2Fodoo.git [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 --- diff --git a/addons/process/process.py b/addons/process/process.py index 524a323..464cf46 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: diff --git a/addons/purchase/process/purchase_process.xml b/addons/purchase/process/purchase_process.xml index ddf557f..e01f6a4 100644 --- a/addons/purchase/process/purchase_process.xml +++ b/addons/purchase/process/purchase_process.xml @@ -135,7 +135,7 @@ - +