From 90e8da9b4f792919c14c7de1d8596bf2056f58b2 Mon Sep 17 00:00:00 2001 From: Kishan Gajjar Date: Mon, 19 Feb 2018 14:39:08 +0530 Subject: [PATCH] [FIX] portal: It ask to login even if user already logged in - options inside the template will not be correct if we set options in start method(template already loaded when start is call), for the correct value of options inside the template we must set it inside willstart (PR #22751) --- addons/portal/static/src/js/portal_chatter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/portal/static/src/js/portal_chatter.js b/addons/portal/static/src/js/portal_chatter.js index c91771174c1..66414d70b5d 100644 --- a/addons/portal/static/src/js/portal_chatter.js +++ b/addons/portal/static/src/js/portal_chatter.js @@ -52,7 +52,8 @@ var PortalChatter = Widget.extend({ params: this._messageFetchPrepareParams() }), this._loadTemplates() ).then(function(result){ - self.result = result + self.result = result; + self.options = _.extend(self.options, self.result['options'] || {}); return result; }); }, @@ -69,7 +70,6 @@ var PortalChatter = Widget.extend({ this.on("change:pager", this, this._renderPager); this.on("change:domain", this, this._onChangeDomain); // set options and parameters - this.options = _.extend(this.options, this.result['options'] || {}); this.set('message_count', this.options['message_count']); this.set('messages', this.preprocessMessages(this.result['messages'])); return this._super.apply(this, arguments);