diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-01-22 17:47:32 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-01-22 17:47:32 +0100 |
| commit | fa1f2132e79f2ac2314a8b417d5d35d6571bd41b (patch) | |
| tree | 3789a8335dd5089998de3c5c6a391b2d95a85187 /addons/mail/static/src | |
| parent | db27489fe756b24647e993a22340705625839698 (diff) | |
| parent | 950d9b2369046f2e3199d144df8edbd0e63f8a2f (diff) | |
[MERGE] forward port branch 11.0 up to 950d9b23690
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/chatter.js | 2 | ||||
| -rw-r--r-- | addons/mail/static/src/js/systray.js | 4 | ||||
| -rw-r--r-- | addons/mail/static/src/js/utils.js | 18 |
3 files changed, 14 insertions, 10 deletions
diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index c8496d62ef4..9d7c357131c 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -258,7 +258,7 @@ var Chatter = Widget.extend(chat_mixin, { var suggested_partners = []; var thread_recipients = result[self.context.default_res_id]; _.each(thread_recipients, function (recipient) { - var parsed_email = utils.parse_email(recipient[1]); + var parsed_email = recipient[1] && utils.parse_email(recipient[1]); suggested_partners.push({ checked: true, partner_id: recipient[0], diff --git a/addons/mail/static/src/js/systray.js b/addons/mail/static/src/js/systray.js index 91bbdbe8275..2006ae297ef 100644 --- a/addons/mail/static/src/js/systray.js +++ b/addons/mail/static/src/js/systray.js @@ -3,7 +3,6 @@ odoo.define('mail.systray', function (require) { var config = require('web.config'); var core = require('web.core'); -var framework = require('web.framework'); var session = require('web.session'); var SystrayMenu = require('web.SystrayMenu'); var Widget = require('web.Widget'); @@ -175,6 +174,9 @@ var ActivityMenu = Widget.extend({ return self._rpc({ model: 'res.users', method: 'activity_user_count', + kwargs: { + context: session.user_context, + }, }).then(function (data) { self.activities = data; self.activityCounter = _.reduce(data, function(total_count, p_data){ return total_count + p_data.total_count; }, 0); diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index 6364be77eb5..49d1705eccd 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -100,15 +100,17 @@ function inline (node, transform_children) { // Parses text to find email: Tagada <address@mail.fr> -> [Tagada, address@mail.fr] or False function parse_email (text) { - var result = text.match(/(.*)<(.*@.*)>/); - if (result) { - return [_.str.trim(result[1]), _.str.trim(result[2])]; - } - result = text.match(/(.*@.*)/); - if (result) { - return [_.str.trim(result[1]), _.str.trim(result[1])]; + if (text){ + var result = text.match(/(.*)<(.*@.*)>/); + if (result) { + return [_.str.trim(result[1]), _.str.trim(result[2])]; + } + result = text.match(/(.*@.*)/); + if (result) { + return [_.str.trim(result[1]), _.str.trim(result[1])]; + } + return [text, false]; } - return [text, false]; } // Replaces textarea text into html text (add <p>, <a>) |
