From 21606d01c8bff747028d024313cbf4db55952146 Mon Sep 17 00:00:00 2001 From: raph Date: Tue, 12 Jan 2016 14:49:55 +0100 Subject: [PATCH] [IMP] web_switch_company_warning Move signature() out of init() --- .../static/src/js/switch_company_warning.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web_switch_company_warning/static/src/js/switch_company_warning.js b/web_switch_company_warning/static/src/js/switch_company_warning.js index f7ba68fb..d24be0ac 100644 --- a/web_switch_company_warning/static/src/js/switch_company_warning.js +++ b/web_switch_company_warning/static/src/js/switch_company_warning.js @@ -25,7 +25,7 @@ openerp.web_switch_company_warning = function (instance) { if (msg.data.type !== 'newCtx') return; - if(msg.data.newCtx != signature(self.session)) { + if(msg.data.newCtx != self.signature(self.session)) { self.$el.show(); } else { self.$el.hide(); @@ -33,11 +33,10 @@ openerp.web_switch_company_warning = function (instance) { }); w.port.start(); - w.port.postMessage(signature(this.session)); - - function signature(session) { + w.port.postMessage(self.signature(this.session)); + }, + signature: function (session) { return [session.db, session.uid, session.company_id].join(); - } } });