[FIX]Fixed the issue of process view condition, here condition has not given more...
authormsh-openerp <msh@tinyerp.com>
Tue, 29 May 2012 11:59:47 +0000 (17:29 +0530)
committermsh-openerp <msh@tinyerp.com>
Tue, 29 May 2012 11:59:47 +0000 (17:29 +0530)
bzr revid: msh@tinyerp.com-20120529115947-g601gem0837b0x3b

addons/process/process.py
addons/purchase/process/purchase_process.xml

index 72c8bce..3d82751 100644 (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
-
-            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:
index ddf557f..e01f6a4 100644 (file)
         <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>