From 026d25e97a6e2fa50b4f1c31e7a869304634d99e Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 24 May 2017 09:22:01 +0200 Subject: [PATCH] [FIX] mail: can't open mail composer on virtual event In the case of a chatter on a calendar virtual event, there was a number of issue because the record ID was of the type "[REAL ID]-[VIRTUAL ID]". This caused issue when fetching and posting message with the composer. opw-744405 closes #17179 --- addons/mail/static/src/js/chatter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index f792af910ff..aa3d916e5be 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -457,11 +457,12 @@ var Chatter = form_common.AbstractField.extend({ pyeval.eval('contexts', this.build_context()) ); this.context = _.extend({ - default_res_id: this.view.datarecord.id || false, + // expect integer ID or false + default_res_id: parseInt(this.view.datarecord.id, 10) || false, default_model: this.view.model || false, }, context); this.thread_dataset = this.view.dataset; - this.res_id = this.view.datarecord.id; + this.res_id = this.context.default_res_id; this.record_name = this.view.datarecord.display_name; this.msg_ids = this.get_value() || [];