From 798b4f76c4b218746b491e077b63b22234cb7600 Mon Sep 17 00:00:00 2001 From: "Abdelouahab (abla)" Date: Wed, 11 Jan 2023 12:52:40 +0000 Subject: [PATCH] [FIX] mail: reading property from undefined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To Reproduce ============ - add event on calendar - edit the event and remove the user from participants list and add another one. - save the record -> traceback Problem ======= we try to read `hasReadAccess` from `this.followedThread` that is `null` in this case. Solution ======== check if `this.followedThread` is `null` or not opw-3126545 closes odoo/odoo#109721 X-original-commit: f9a23af63bb5fe882f0d42f06ef1406910836115 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/follower.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/models/follower.js b/addons/mail/static/src/models/follower.js index 0bccdcaca3f..c8c6f08d150 100644 --- a/addons/mail/static/src/models/follower.js +++ b/addons/mail/static/src/models/follower.js @@ -169,8 +169,11 @@ Model({ const hasWriteAccess = this.followedThread ? this.followedThread.hasWriteAccess : false; - return this.messaging.currentPartner === this.partner + const hasReadAccess = this.followedThread ? this.followedThread.hasReadAccess + : false; + return this.messaging.currentPartner === this.partner + ? hasReadAccess : hasWriteAccess; }, }),