From 722163893e693cbbfe70050ad29e5740443a2a5d Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 11 Feb 2014 09:25:46 +0100 Subject: [PATCH] [FIX] ir.actions: active_model may not always match current model, in which case `object` should be `None` bzr revid: odo@openerp.com-20140211082546-tgenye70etn21ih5 --- openerp/addons/base/ir/ir_actions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index b8ac990a052..31677eb8c27 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -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