[FIX] ir.actions: active_model may not always match current model, in which case...
authorOlivier Dony <odo@openerp.com>
Tue, 11 Feb 2014 08:25:46 +0000 (09:25 +0100)
committerOlivier Dony <odo@openerp.com>
Tue, 11 Feb 2014 08:25:46 +0000 (09:25 +0100)
bzr revid: odo@openerp.com-20140211082546-tgenye70etn21ih5

openerp/addons/base/ir/ir_actions.py

index b8ac990..31677eb 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+    # -*- coding: utf-8 -*-
 ##############################################################################
 #
 #    OpenERP, Open Source Management Solution
@@ -979,6 +979,7 @@ class actions_server(osv.osv):
         model = self.pool[action.model_id.model]
         active_id = context.get('active_id')
         active_ids = context.get('active_ids', [active_id] if active_id else [])
+        target_record = None
         if context.get('active_model') == action.model_id.model and active_id:
             context = dict(context, active_ids=active_ids, active_id=active_id)
             target_record = model.browse(cr, uid, active_id, context=context) if active_id else None
@@ -997,7 +998,7 @@ class actions_server(osv.osv):
             'context': context,
         }
         return eval_context
-        
+
 
     def run(self, cr, uid, ids, context=None):
         """ Run the server action. For each server action, the condition is