From 2d54b3eec1500dde43583ca1599ef12be4c7cad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Mon, 28 Sep 2020 16:55:09 +0000 Subject: [FIX] mail: prevent sync fold state for non-channels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit task-2346650 closes odoo/odoo#58794 X-original-commit: f5b6e78e77eac27af3b3812ac3818a67acaa1c85 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/thread/thread.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addons/mail/static/src/models/thread/thread.js') diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index bd40751ca59..4ad43577b1f 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -616,6 +616,13 @@ function factory(dependencies) { * @param {string} state */ async notifyFoldStateToServer(state) { + if (this.model !== 'mail.channel') { + // Server sync of fold state is only supported for channels. + return; + } + if (!this.uuid) { + return; + } return this.env.models['mail.thread'].performRpcChannelFold(this.uuid, state); } -- cgit v1.2.3