summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/chat_manager.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-08-26 14:57:43 +0200
committerChristophe Simonis <chs@odoo.com>2016-08-26 14:57:43 +0200
commit717a4a51a5bf03f853aa2e4c229b929e2b87ea2d (patch)
treebc0a9d2c758e7055cb0cd23f12c1c33b04b2a872 /addons/mail/static/src/js/chat_manager.js
parent438a3742e238ba074b880d5d563f2c7151a767c6 (diff)
parent7a4116cd03c56d694a1b6d39a523ac1cc3306f52 (diff)
[MERGE] forward port branch saas-10 up to 7a4116c
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 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,
}));