If you want to redirect to another object when an event occurs like click of a button, then you just need to return dictionary having the following syntax-
return {
‘name’:_(“Name of the form”),
‘view_mode’: ‘form’,
‘view_id’: False,
‘views’: [(resource_id,’form’)],
‘view_type’: ‘form’,
‘res_id’ : res_id, # id of the object to which to redirected
‘res_model’: ‘stock.picking’, # object name
‘type’: ‘ir.actions.act_window’,
‘target’: ‘new’, # if you want to open the form in new tab
}

Advertisements