[ADD] redirect on login and logout controller
bzr revid: fme@openerp.com-20131104171530-96irkaom2vjsj9s5
This commit is contained in:
parent
8a52fe77f8
commit
9a281f829b
|
@ -929,6 +929,11 @@ class Session(http.Controller):
|
|||
def destroy(self):
|
||||
request.session.logout()
|
||||
|
||||
@http.route('/web/session/logout', type='http', auth="user")
|
||||
def destroy(self, redirect='/'):
|
||||
request.session.logout()
|
||||
return werkzeug.utils.redirect(redirect, 303)
|
||||
|
||||
class Menu(http.Controller):
|
||||
|
||||
@http.route('/web/menu/get_user_roots', type='json', auth="user")
|
||||
|
|
|
@ -1377,7 +1377,11 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
|
||||
this.action_manager.do_action(action);
|
||||
this.action_manager.inner_widget.on('login_successful', this, function() {
|
||||
this.show_application(); // will load the state we just pushed
|
||||
if ('redirect' in state) {
|
||||
openerp.web.redirect(state.redirect);
|
||||
} else {
|
||||
this.show_application(); // will load the state we just pushed
|
||||
}
|
||||
});
|
||||
},
|
||||
show_application: function() {
|
||||
|
|
Loading…
Reference in New Issue