[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:
parent
115607339a
commit
caef181733
|
@ -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 {}
|
||||
|
|
Loading…
Reference in New Issue