[ADD] redirect on login and logout controller

bzr revid: fme@openerp.com-20131104171530-96irkaom2vjsj9s5
This commit is contained in:
Fabien Meghazi 2013-11-04 18:15:30 +01:00
parent 8a52fe77f8
commit 9a281f829b
2 changed files with 10 additions and 1 deletions

View File

@ -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")

View File

@ -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() {