[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
This commit is contained in:
Xavier BOL (xbo)
2021-11-05 17:14:42 +01:00
parent c0c1af4ca2
commit aeac9052b8
@@ -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]) => {