From caef1817336e6d5e93893d59acd39306899c7ef4 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 16 Sep 2011 12:14:32 +0200 Subject: [PATCH] [FIX] ir_action: avoid returning a None context. lp bug: https://launchpad.net/bugs/793682 fixed bzr revid: vmt@openerp.com-20110916101432-cj8xd7uefy0k5suz --- openerp/addons/base/ir/ir_actions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index 19bf00796f1..97a45ad05c8 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -458,12 +458,14 @@ class actions_server(osv.osv): def change_object(self, cr, uid, ids, copy_object, state, context=None): if state == 'object_copy': + if context is None: + context = {} model_pool = self.pool.get('ir.model') model = copy_object.split(',')[0] mid = model_pool.search(cr, uid, [('model','=',model)]) return { - 'value':{'srcmodel_id':mid[0]}, - 'context':context + 'value': {'srcmodel_id': mid[0]}, + 'context': context } else: return {}