diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-08-26 14:57:43 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-08-26 14:57:43 +0200 |
| commit | 717a4a51a5bf03f853aa2e4c229b929e2b87ea2d (patch) | |
| tree | bc0a9d2c758e7055cb0cd23f12c1c33b04b2a872 /addons/mail/static | |
| parent | 438a3742e238ba074b880d5d563f2c7151a767c6 (diff) | |
| parent | 7a4116cd03c56d694a1b6d39a523ac1cc3306f52 (diff) | |
[MERGE] forward port branch saas-10 up to 7a4116c
Diffstat (limited to 'addons/mail/static')
| -rw-r--r-- | addons/mail/static/src/js/chat_manager.js | 18 | ||||
| -rw-r--r-- | addons/mail/static/src/js/thread.js | 14 |
2 files changed, 17 insertions, 15 deletions
diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index e3a11b19197..4e0df85c703 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -213,6 +213,22 @@ function make_message (data) { a.url = '/web/content/' + a.id + '?download=true'; }); + // format date to the local only once by message + // can not be done in preprocess, since it alter the original value + if (msg.tracking_value_ids && msg.tracking_value_ids.length) { + _.each(msg.tracking_value_ids, function(f) { + if (_.contains(['date', 'datetime'], f.field_type)) { + var format = (f.field_type === 'date') ? 'LL' : 'LLL'; + if (f.old_value) { + f.old_value = moment.utc(f.old_value).local().format(format); + } + if (f.new_value) { + f.new_value = moment.utc(f.new_value).local().format(format); + } + } + }); + } + return msg; } @@ -653,7 +669,7 @@ var chat_manager = { // post a message in a channel or execute a command return ChannelModel.call(data.command ? 'execute_command' : 'message_post', [options.channel_id], _.extend(msg, { message_type: 'comment', - content_subtype: 'html', + content_subtype: 'plaintext', subtype: 'mail.mt_comment', command: data.command, })); diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js index 17b21c39a5b..ea593d21dfa 100644 --- a/addons/mail/static/src/js/thread.js +++ b/addons/mail/static/src/js/thread.js @@ -234,20 +234,6 @@ var Thread = Widget.extend({ msg.day = msg.date.format('LL'); } - if (message.tracking_value_ids && message.tracking_value_ids.length) { - _.each(message.tracking_value_ids, function(f) { - if (_.contains(['date', 'datetime'], f.field_type)) { - var format = (f.field_type === 'date') ? 'LL' : 'LLL'; - if (f.old_value) { - f.old_value = moment.utc(f.old_value).local().format(format); - } - if (f.new_value) { - f.new_value = moment.utc(f.new_value).local().format(format); - } - } - }); - } - if (_.contains(this.expanded_msg_ids, message.id)) { msg.expanded = true; } |
