Odoo Help


Redirect a View

aci aisha
on 1/23/15, 5:30 AM 1,039 views

How to redirect a view when clicking a button...

On 1/23/15, 7:35 AM

Hi aci aisha,

You can use 2 ways of redirect a view from the button click.

1.       return {

                     'name' : 'Module name',

                      'view_type' : 'form',

                      'view_mode' : 'form',

                       'view_id': False,

                        'res_model' : 'res.partner',

                        'context' : context,

                        'type' : 'ir.actions.act_window',

                         'target' : 'current',



2.       mod_obj = self.pool.get('ir.model.data')

           res = mod_obj.get_object_reference(cr, uid, 'res_partner', 'res_partner_form_view')

          res_id = res and res[1] or False


                    'name':'Module name',


                     'type': 'ir.actions.act_window',

                      'view_type': 'form',

                      'view_mode': 'form',

                       'view_id': [res_id],




In xml_view:

<button name="method name"  type="object" />

Put that code in the return of the method.Hope it works..All the best

Thanks a lot Vasanth...

aci aisha
on 1/28/15, 12:38 AM

But 1 problem,, When clicking the button i got a new window,, But there is no save button in that window... Can u help..

aci aisha
on 1/28/15, 12:59 AM

use 'target':'current'

on 1/28/15, 1:01 AM

Thanks a lot my dear...

aci aisha
on 1/28/15, 1:04 AM

Where are u from?

aci aisha
on 1/28/15, 1:04 AM


on 1/28/15, 1:05 AM

Hw r u

aci aisha
on 1/28/15, 1:06 AM

come to my personal email...vsnthajay@gmail.com

on 1/28/15, 1:08 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/23/15, 5:30 AM
Seen: 1039 times
Last updated: 3/16/15, 8:10 AM