rename Connection into Session, now that we use instance
bzr revid: al@openerp.com-20120426222552-rqm974o8c9v1s4lk
This commit is contained in:
parent
3bf883c95e
commit
fb83a403c4
|
@ -14,8 +14,8 @@
|
|||
var openerp = this.openerp = {
|
||||
// Per session namespace
|
||||
// openerp.<module> will map to
|
||||
// openerp.sessions.sessionname.<module> using a closure
|
||||
sessions: {},
|
||||
// openerp.instances.sessionname.<module> using a closure
|
||||
instances: {},
|
||||
/**
|
||||
* OpenERP instance constructor
|
||||
*
|
||||
|
@ -23,19 +23,19 @@
|
|||
*/
|
||||
init: function(modules) {
|
||||
// By default only web will be loaded, the rest will be by loaded
|
||||
// by openerp.web.Connection on the first session_authenticate
|
||||
// by openerp.web.Session on the first session_authenticate
|
||||
modules = modules || ["web"];
|
||||
var new_instance = {
|
||||
// links to the global openerp
|
||||
_openerp: openerp,
|
||||
// this unique id will be replaced by hostname_databasename by
|
||||
// openerp.web.Connection on the first connection
|
||||
_session_id: "session" + session_counter++,
|
||||
// openerp.web.Session on the first connection
|
||||
_session_id: "instance" + session_counter++,
|
||||
_modules: modules,
|
||||
web: {},
|
||||
web_mobile: {}
|
||||
};
|
||||
openerp.sessions[new_instance._session_id] = new_instance;
|
||||
openerp.instances[new_instance._session_id] = new_instance;
|
||||
for(var i=0; i < modules.length; i++) {
|
||||
openerp[modules[i]](new_instance);
|
||||
}
|
||||
|
|
|
@ -756,7 +756,7 @@ instance.web.Registry = instance.web.Class.extend({
|
|||
* registry was created.
|
||||
*
|
||||
* An object path is simply a dotted name from the instance root to the
|
||||
* object pointed to (e.g. ``"instance.web.Connection"`` for an OpenERP
|
||||
* object pointed to (e.g. ``"instance.web.Session"`` for an OpenERP
|
||||
* connection object).
|
||||
*
|
||||
* @constructs instance.web.Registry
|
||||
|
@ -1341,7 +1341,7 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({
|
|||
},
|
||||
});
|
||||
|
||||
instance.web.Connection = instance.web.JsonRPC.extend( /** @lends instance.web.Connection# */{
|
||||
instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Session# */{
|
||||
init: function() {
|
||||
this._super.apply(this, arguments);
|
||||
// TODO: session store in cookie should be optional
|
||||
|
|
|
@ -98,8 +98,8 @@ $.Mutex = (function() {
|
|||
return Mutex;
|
||||
})();
|
||||
|
||||
/** Setup default connection */
|
||||
instance.connection = new instance.web.Connection();
|
||||
/** Setup default session */
|
||||
instance.connection = new instance.web.Session();
|
||||
instance.web.qweb.default_dict['__debug__'] = instance.connection.debug;
|
||||
|
||||
$.async_when = function() {
|
||||
|
|
Loading…
Reference in New Issue