summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/thread.js
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2016-08-23 14:42:46 +0200
committerJeremy Kersten <jke@odoo.com>2016-08-23 15:23:20 +0200
commit1b2dab3f506d51b399625dba614dd3689e95bdc9 (patch)
tree5e3cdde372898ad84d0eeb83fac230163434630b /addons/mail/static/src/js/thread.js
parent6d4bb4f18c8820bd9115bbcfe1a4b0337585b991 (diff)
[FIX] mail: preprocess tracking fields of type date/datetime only once
Before this commit, if a message thread was loaded 2 times, the first time the date was well formatted, the second time that fail because momentjs cannot parse the localized date from some locale. Luckily, it was not bugged by default in english, because moment was able to reparse a localized US date. But in some local as french, momentjs cannot parse the localized date and return 'Invalid date' Now, we move the code, to be processed only once by the chat manager, and not in each process of the thread. This commit closes issue #13258 Courtesy of @aab-odoo
Diffstat (limited to 'addons/mail/static/src/js/thread.js')
-rw-r--r--addons/mail/static/src/js/thread.js14
1 files changed, 0 insertions, 14 deletions
diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js
index f0d5ae05339..ac4c50b4533 100644
--- a/addons/mail/static/src/js/thread.js
+++ b/addons/mail/static/src/js/thread.js
@@ -151,20 +151,6 @@ var Thread = Widget.extend({
msg.hour = msg.date.format('LT');
}
- 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;
}