Odoo Help

Welcome!

This community 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.

0

How to open url and close a wizard in 1 function in Odoo 8.0

By
NhuVanTran
on 6/25/15, 11:19 PM 806 views

Hi all,

I created a wizard with a button. When I click to this button, I want to close the wizard and open a url in new tab. But in my case, I can only close the wizard or open url by using return in my function (not both at same time)

If want to open url, so I return my function as below

return {
            'type' : 'ir.actions.act_url',
            'url' : url,
            'target' : 'new',
        }

And if I want to close the wizard (not open url), I write

return {'type': 'ir.actions.act_window_close'} 

In other way, I tred creating other function, as below, to open url and called it before return ir.actions.act_window_close in my function. But it was not work, url could not be opened

 def _open_url(self, cr, uid, ids, url, context=None):
        return {
            'type' : 'ir.actions.act_url',
            'url' : url,
            'target' : 'new',
        }


Finally, How can I close the wizard and open url at same time in only 1 function?

Thanks

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/25/15, 11:19 PM
Seen: 806 times
Last updated: 6/25/15, 11:21 PM