[IMP] sed -i '' -e 's/connection/session/g'

bzr revid: chs@openerp.com-20120814153053-3bznfj7woq2xi1f1
This commit is contained in:
Christophe Simonis 2012-08-14 17:30:53 +02:00
parent 63e4d9b572
commit c5dc5cef00
6 changed files with 14 additions and 14 deletions

View File

@ -31,7 +31,7 @@ openerp.auth_reset_password = function(instance) {
}, },
do_reset_password: function(db, email) { do_reset_password: function(db, email) {
var self = this; var self = this;
instance.connection.session_authenticate(db, 'anonymous', 'anonymous', true).pipe(function () { instance.session.session_authenticate(db, 'anonymous', 'anonymous', true).pipe(function () {
var func = new instance.web.Model("res.users").get_func("send_reset_password_request"); var func = new instance.web.Model("res.users").get_func("send_reset_password_request");
return func(email).then(function(res) { return func(email).then(function(res) {
// show message // show message

View File

@ -12,7 +12,7 @@ openerp.auth_signup = function(instance) {
return false; return false;
} }
var cnx = instance.connection; var cnx = instance.session;
if (cnx.session_is_valid()) { if (cnx.session_is_valid()) {
self._signup(); self._signup();
} else { } else {
@ -83,7 +83,7 @@ openerp.auth_signup = function(instance) {
type: 'ir.actions.client', type: 'ir.actions.client',
tag: 'login', tag: 'login',
params: { params: {
db: instance.connection.db, db: instance.session.db,
login: email, login: email,
password: password, password: password,
login_successful: function() { login_successful: function() {

View File

@ -6,7 +6,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
this._super(); this._super();
this.db = db; this.db = db;
this.token = token; this.token = token;
this.session = openerp.connection; this.session = openerp.session;
this.template = "EdiEmpty"; this.template = "EdiEmpty";
this.content = ""; this.content = "";
this.sidebar = ""; this.sidebar = "";
@ -108,7 +108,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
}); });
openerp.edi.edi_view = function (db, token) { openerp.edi.edi_view = function (db, token) {
openerp.connection.session_bind().then(function () { openerp.session.session_bind().then(function () {
new openerp.edi.EdiView(null,db,token).appendTo($("body").addClass('openerp')); new openerp.edi.EdiView(null,db,token).appendTo($("body").addClass('openerp'));
}); });
} }
@ -188,7 +188,7 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({
}); });
openerp.edi.edi_import = function (url) { openerp.edi.edi_import = function (url) {
openerp.connection.session_bind().then(function () { openerp.session.session_bind().then(function () {
new openerp.edi.EdiImport(null,url).appendTo($("body").addClass('openerp')); new openerp.edi.EdiImport(null,url).appendTo($("body").addClass('openerp'));
}); });
} }

View File

@ -674,7 +674,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
self.$('.loader img').hide(); self.$('.loader img').hide();
return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_pos_session_opening']], ['res_id']) return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_pos_session_opening']], ['res_id'])
.pipe( _.bind(function(res){ .pipe( _.bind(function(res){
return instance.connection.rpc('/web/action/load', {'action_id': res[0]['res_id']}) return instance.session.rpc('/web/action/load', {'action_id': res[0]['res_id']})
.pipe(_.bind(function(result){ .pipe(_.bind(function(result){
var action = result.result; var action = result.result;
this.do_action(action); this.do_action(action);

View File

@ -35,19 +35,19 @@ openerp.share = function(session) {
} }
function has_share(yes, no) { function has_share(yes, no) {
if (!session.connection.share_flag) { if (!session.session.share_flag) {
session.connection.share_flag = $.Deferred(function() { session.session.share_flag = $.Deferred(function() {
var func = new session.web.Model("share.wizard").get_func("has_share"); var func = new session.web.Model("share.wizard").get_func("has_share");
func(session.connection.uid).pipe(function(res) { func(session.session.uid).pipe(function(res) {
if(res) { if(res) {
session.connection.share_flag.resolve(); session.session.share_flag.resolve();
} else { } else {
session.connection.share_flag.reject(); session.session.share_flag.reject();
} }
}); });
}); });
} }
session.connection.share_flag.done(yes).fail(no); session.session.share_flag.done(yes).fail(no);
} }
/* Extend the Sidebar to add Share and Embed links in the 'More' menu */ /* Extend the Sidebar to add Share and Embed links in the 'More' menu */

View File

@ -78,7 +78,7 @@ openerp.web_linkedin = function(instance) {
}, _.bind(this.linkedin_disabled, this)); }, _.bind(this.linkedin_disabled, this));
}, },
linkedin_disabled: function() { linkedin_disabled: function() {
if (instance.connection.uid !== 1) { if (instance.session.uid !== 1) {
instance.web.dialog($(QWeb.render("LinkedIn.DisabledWarning")), { instance.web.dialog($(QWeb.render("LinkedIn.DisabledWarning")), {
title: _t("LinkedIn is not enabled"), title: _t("LinkedIn is not enabled"),
buttons: [ buttons: [