[FIX] ir_action: avoid returning a None context.

lp bug: https://launchpad.net/bugs/793682 fixed

bzr revid: vmt@openerp.com-20110916101432-cj8xd7uefy0k5suz
This commit is contained in:
Vo Minh Thu 2011-09-16 12:14:32 +02:00
parent 115607339a
commit caef181733
1 changed files with 4 additions and 2 deletions

View File

@ -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 {}