Odoo Help


How to navigate back in view history (SOLVED)

Pau Ubach
on 10/10/14, 2:12 AM 1,641 views

This question is related to:

When I'm navigating between views, in the header I can see this history:

Example: Opportunities / New oportunity / Administrator 
Clicking in New oportunity would navigate one view back, clicking in Opportunities would navigate 2 views back.

How can I do this automatically from a function in python? 

I have managed to create a new view, but can't go back to last view.



Pau Ubach
On 10/14/14, 2:28 AM

I managed to solve it!! (where's the smiley of infinite happiness?)

I just navigate back in browser history.

For this I need to create an action: 

        <record model="ir.actions.client" id="action_client_back">
            <field name="name">instance.bdt.Back</field>
            <field name="tag">bdt.back</field>
            <field name="params">{}</field>

and the JS function:

openerp.request_project = function(instance) {
    instance.request_project = {};
    instance.request_project.back = function(){
    instance.web.client_actions.add('bdt.back', 'instance.request_project.back');

So, when I finish what button does I can return back:

return {'type': 'ir.actions.client', 'tag': 'bdt.back'}
On 4/6/16, 3:38 AM

To navigate back in history,

you don't need to create a new function. It is already in Odoo.

Just add at the end of your button python function:

return {'type': 'ir.actions.client', 'tag': 'history_back'}


Techno-Functional Associate with 7+ years of experience in Odoo (formerly known as OpenERP).

On 10/10/14, 3:17 AM

If you are meaning, to load a particular action...

then in your return statement of the function, return the action / ir_act_window...


model_obj = self.pool.get('ir.model.data')
form_view = model_obj._get_id(cr, uid, 'MODULE_NAME', 'XML_VIEW')
if form_view:
            form_view = model_obj.browse(cr, uid, form_view, context=context).res_id

return {
                    'view_type' : 'form',
                    'view_mode' : 'form',
                    'res_model' : 'MODEL',
                    'res_id'    : False,
                    'view_id'   : False,
                    'views'     : [(form_view, 'form'), ],
                    'type'      : 'ir.actions.act_window',
                    'target'    : 'current',

You can also refer in standard, Invoice to Refund option as well, in which when an invoice is refunded, it loads action of Refunds...

Hi deep, thanks but I don't mean it. You can check the link to the other question.

Pau Ubach
on 10/10/14, 4:29 AM

Now I do as you described, and the problem is that I get a new element in the navigation history instead of deleting the last one.

Pau Ubach
on 10/10/14, 4:31 AM

add reload: True in the value list

on 10/10/14, 4:54 AM

'tag': 'reload',

on 10/10/14, 4:55 AM

Could you clarify last answer?

Pau Ubach
on 10/10/14, 4:56 AM

If still the problem persists, then you can write you own widget to do the same....

on 10/10/14, 4:57 AM

I didnt get... which one?

on 10/10/14, 5:03 AM

I tried reload, but it doesn't go to the previous view, it just refresh the new one.

Pau Ubach
on 10/10/14, 5:05 AM

Thanks anyway deep.

Pau Ubach
on 10/10/14, 5:50 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: 10/10/14, 2:12 AM
Seen: 1641 times
Last updated: 4/6/16, 3:38 AM