From 5d3686556ff24781f339904fa38776e23db4f1e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 29 Sep 2020 09:22:13 +0000 Subject: [PATCH] [FIX] mail: properly clear chatter id on new record MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit task-2348372 closes odoo/odoo#58824 X-original-commit: 189ff0af0ac209624910a7674f543d2d58ecb94f Signed-off-by: Alexandre Kühn (aku) --- .../src/components/chatter_container/chatter_container.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/components/chatter_container/chatter_container.js b/addons/mail/static/src/components/chatter_container/chatter_container.js index 0c5de5208fc..88c4775d28c 100644 --- a/addons/mail/static/src/components/chatter_container/chatter_container.js +++ b/addons/mail/static/src/components/chatter_container/chatter_container.js @@ -5,6 +5,7 @@ const components = { Chatter: require('mail/static/src/components/chatter/chatter.js'), }; const useStore = require('mail/static/src/component_hooks/use_store/use_store.js'); +const { clear } = require('mail/static/src/model/model_field_command.js'); const { Component } = owl; @@ -59,7 +60,11 @@ class ChatterContainer extends Component { */ _update() { if (this.chatter) { - this.chatter.update(this.props); + const values = Object.assign({}, this.props); + if (values.threadId === undefined) { + values.threadId = clear(); + } + this.chatter.update(values); } }