From aeac9052b8dcb0f688f5d5fca160f6524134dcb3 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Wed, 22 Sep 2021 17:37:53 +0200 Subject: [PATCH] [FIX] portal: get all options when we reload the chatter Before this commit, we use the defaultOptions and the options passed in parameter of the `_setOptions` method, but we could have any unupdated options in the `this.options`. This commit creates a new object with the defaultOptions and the options containing in `this.options` before update this object with `options` given in parameter to have the new `this.options`. task-2633229 closes #77156 X-original-commit: 5d1a36bdd530d4037d4f29dc607907d79d18dcc6 --- 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 0f379460d06..ec399e5075d 100644 --- a/addons/portal/static/src/js/portal_chatter.js +++ b/addons/portal/static/src/js/portal_chatter.js @@ -122,7 +122,7 @@ var PortalChatter = publicWidget.Widget.extend({ */ _setOptions: function (options) { // underscorize the camelcased option keys - const defaultOptions = { + const defaultOptions = Object.assign({ 'allow_composer': true, 'display_composer': false, 'csrf_token': odoo.csrf_token, @@ -137,7 +137,7 @@ var PortalChatter = publicWidget.Widget.extend({ 'pid': false, 'domain': [], 'two_columns': false, - }; + }, this.options || {}); this.options = Object.entries(options).reduce( (acc, [key, value]) => {