[FIX] embed client do not save the session to a cookie

bzr revid: chs@openerp.com-20111221104031-yfek5s723icczxv7
This commit is contained in:
Christophe Simonis
2011-12-21 11:40:31 +01:00
parent bac17b7cf6
commit b1a73094ff
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -1132,7 +1132,7 @@ openerp.web.embed = function (origin, dbname, login, key, action, options) {
currentScript = sc[sc.length-1];
}
openerp.connection.bind(origin).then(function () {
openerp.connection.session_authenticate(dbname, login, key).then(function () {
openerp.connection.session_authenticate(dbname, login, key, true).then(function () {
var client = new openerp.web.EmbeddedClient(action, options);
client.insertAfter(currentScript);
});
+4 -3
View File
@@ -564,7 +564,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
/**
* The session is validated either by login or by restoration of a previous session
*/
session_authenticate: function(db, login, password) {
session_authenticate: function(db, login, password, volatile) {
var self = this;
var base_location = document.location.protocol + '//' + document.location.host;
var params = { db: db, login: login, password: password, base_location: base_location };
@@ -576,8 +576,9 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
uid: result.uid,
user_context: result.context
});
// TODO: session store in cookie should be optional
self.set_cookie('session_id', self.session_id);
if (!volatile) {
self.set_cookie('session_id', self.session_id);
}
return self.load_modules();
});
},