summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/chat_manager.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-08-25 18:23:47 +0200
committerChristophe Simonis <chs@odoo.com>2016-08-25 18:23:47 +0200
commit5c2025a3affdcbcd06c40b2454b70b2d64528a03 (patch)
tree9b2085cca3340d504d983f9e0c49206bf111ce57 /addons/mail/static/src/js/chat_manager.js
parent04602995490b623e3e30b88386fe4bc673ce9002 (diff)
parentc578fb792c8fc48ebf1d0a5689d9201813e1004e (diff)
[MERGE] forward port branch 9.0 up to c578fb7
Diffstat (limited to 'addons/mail/static/src/js/chat_manager.js')
-rw-r--r--addons/mail/static/src/js/chat_manager.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js
index 28138fbeaab..8710c7195a3 100644
--- a/addons/mail/static/src/js/chat_manager.js
+++ b/addons/mail/static/src/js/chat_manager.js
@@ -206,6 +206,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;
}
@@ -623,7 +639,7 @@ var chat_manager = {
// post a message in a channel
return ChannelModel.call('message_post', [options.channel_id], _.extend(msg, {
message_type: 'comment',
- content_subtype: 'html',
+ content_subtype: 'plaintext',
subtype: 'mail.mt_comment',
}));
}