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 = {
|
var openerp = this.openerp = {
|
||||||
// Per session namespace
|
// Per session namespace
|
||||||
// openerp.<module> will map to
|
// openerp.<module> will map to
|
||||||
// openerp.sessions.sessionname.<module> using a closure
|
// openerp.instances.sessionname.<module> using a closure
|
||||||
sessions: {},
|
instances: {},
|
||||||
/**
|
/**
|
||||||
* OpenERP instance constructor
|
* OpenERP instance constructor
|
||||||
*
|
*
|
||||||
|
@ -23,19 +23,19 @@
|
||||||
*/
|
*/
|
||||||
init: function(modules) {
|
init: function(modules) {
|
||||||
// By default only web will be loaded, the rest will be by loaded
|
// 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"];
|
modules = modules || ["web"];
|
||||||
var new_instance = {
|
var new_instance = {
|
||||||
// links to the global openerp
|
// links to the global openerp
|
||||||
_openerp: openerp,
|
_openerp: openerp,
|
||||||
// this unique id will be replaced by hostname_databasename by
|
// this unique id will be replaced by hostname_databasename by
|
||||||
// openerp.web.Connection on the first connection
|
// openerp.web.Session on the first connection
|
||||||
_session_id: "session" + session_counter++,
|
_session_id: "instance" + session_counter++,
|
||||||
_modules: modules,
|
_modules: modules,
|
||||||
web: {},
|
web: {},
|
||||||
web_mobile: {}
|
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++) {
|
for(var i=0; i < modules.length; i++) {
|
||||||
openerp[modules[i]](new_instance);
|
openerp[modules[i]](new_instance);
|
||||||
}
|
}
|
||||||
|
|
|
@ -756,7 +756,7 @@ instance.web.Registry = instance.web.Class.extend({
|
||||||
* registry was created.
|
* registry was created.
|
||||||
*
|
*
|
||||||
* An object path is simply a dotted name from the instance root to the
|
* 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).
|
* connection object).
|
||||||
*
|
*
|
||||||
* @constructs instance.web.Registry
|
* @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() {
|
init: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
// TODO: session store in cookie should be optional
|
// TODO: session store in cookie should be optional
|
||||||
|
|
|
@ -98,8 +98,8 @@ $.Mutex = (function() {
|
||||||
return Mutex;
|
return Mutex;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/** Setup default connection */
|
/** Setup default session */
|
||||||
instance.connection = new instance.web.Connection();
|
instance.connection = new instance.web.Session();
|
||||||
instance.web.qweb.default_dict['__debug__'] = instance.connection.debug;
|
instance.web.qweb.default_dict['__debug__'] = instance.connection.debug;
|
||||||
|
|
||||||
$.async_when = function() {
|
$.async_when = function() {
|
||||||
|
|
Loading…
Reference in New Issue