From 0cc6390db5e759bfbfbbf2272f342eba391926fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 19 Jul 2019 14:18:17 +0000 Subject: [PATCH] [FIX] sms: do not display popover for void notification PURPOSE Improve SMS UX integration. Followup of merge 4287481 . SPECIFICATIONS Fix recent SMS merge: do not display tooltip / popover about SMS information in chatter if there was no recipients linked to the SMS message. LINKS Task 1922187 --- addons/sms/static/src/js/message.js | 8 ++++++++ addons/sms/static/src/xml/thread.xml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/sms/static/src/js/message.js b/addons/sms/static/src/js/message.js index f800563fd72..b5463ae9f8f 100644 --- a/addons/sms/static/src/js/message.js +++ b/addons/sms/static/src/js/message.js @@ -32,6 +32,14 @@ Message.include({ }); return this._smsStatus; }, + /** + * Whether message has nay SMS-related notification + * + * @returns {boolean} + */ + hasSmsData: function () { + return !!(this._smsIds && (this._smsIds.length > 0)); + }, /** * Does the message contains at least one SMS failure * diff --git a/addons/sms/static/src/xml/thread.xml b/addons/sms/static/src/xml/thread.xml index b01524ba609..a28e70f0fa7 100644 --- a/addons/sms/static/src/xml/thread.xml +++ b/addons/sms/static/src/xml/thread.xml @@ -3,7 +3,7 @@ - +