summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-08-26 16:59:45 +0200
committerChristophe Simonis <chs@odoo.com>2016-08-26 16:59:45 +0200
commitde0d503421f0eb7ee14e98f2a627d11fd79aa7fd (patch)
tree1ac0adbeaf08ebbe13f969b940afbae3c9d581b2 /addons/mail/static/src/js
parentc8551260696f8979d67a5ae2d48d3cfca1128581 (diff)
parentf0c8224175159d4fad8f511ede16cec7824d58c4 (diff)
[MERGE] forward port branch saas-11 up to f0c8224
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/chat_manager.js18
-rw-r--r--addons/mail/static/src/js/thread.js14
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 34d687ba8dc..d37e9dcf282 100644
--- a/addons/mail/static/src/js/chat_manager.js
+++ b/addons/mail/static/src/js/chat_manager.js
@@ -214,6 +214,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;
}
@@ -654,7 +670,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;
}