[FIX] portal_anonymous: revert incorrect fix for login flickering, try another one that works in monodb mode

The previous fix at revision 8887 was not correct because start() did not call
 _super() in anonymous mode, while still depending on the value of 
`self.selected_db`, that _super() is responsible for setting in monodb mode.
Multi-db mode was working fine.

bzr revid: odo@openerp.com-20130319181137-9quokmivgb3flyct
This commit is contained in:
Olivier Dony 2013-03-19 19:11:37 +01:00
parent 43f2dff179
commit e6cca53967
1 changed files with 11 additions and 7 deletions

View File

@ -42,14 +42,18 @@ openerp.portal_anonymous = function(instance) {
instance.web.Login.include({
start: function() {
if (!this.session.session_is_valid() && !(this.params.token || this.params.login)) {
this.$el.hide();
this.remember_credentials = false;
// XXX get login/pass from server (via a rpc call) ?
return this.do_login(this.selected_db, 'anonymous', 'anonymous');
} else {
return this._super.apply(this, arguments);
var self = this;
var anonymous_mode = (!self.session.session_is_valid() && !(self.params.token || self.params.login));
if (anonymous_mode) {
self.$el.hide();
}
return $.when(this._super()).then(function() {
if (anonymous_mode) {
self.remember_credentials = false;
// XXX get login/pass from server (via a rpc call) ?
return self.do_login(self.selected_db, 'anonymous', 'anonymous');
}
});
},
});