diff --git a/mail_tracking/models/mail_message.py b/mail_tracking/models/mail_message.py index dc765c3..8a4423b 100644 --- a/mail_tracking/models/mail_message.py +++ b/mail_tracking/models/mail_message.py @@ -69,9 +69,13 @@ class MailMessage(models.Model): status = self._partner_tracking_status_get(tracking) recipient = ( tracking.partner_id.name or tracking.recipient) - partner_trackings.append(( - status, tracking.id, recipient, tracking.partner_id.id, - False)) + partner_trackings.append({ + 'status': status, + 'tracking_id': tracking.id, + 'recipient': recipient, + 'partner_id': tracking.partner_id.id, + 'isCc': False, + }) if tracking.partner_id: email_cc_list.discard(tracking.partner_id.email) partners_already |= tracking.partner_id @@ -84,17 +88,27 @@ class MailMessage(models.Model): partners -= partners_already for partner in partners: # If there is partners not included, then status is 'unknown' - # Because can be an Cc recipinet + # Because can be an Cc recipient isCc = False if partner.email in email_cc_list: email_cc_list.discard(partner.email) isCc = True - partner_trackings.append(( - 'unknown', False, partner.name, partner.id, isCc)) + partner_trackings.append({ + 'status': 'unknown', + 'tracking_id': False, + 'recipient': partner.name, + 'partner_id': partner.id, + 'isCc': isCc, + }) for email in email_cc_list: # If there is Cc without partner - partner_trackings.append(( - 'unknown', False, email, False, True)) + partner_trackings.append({ + 'status': 'unknown', + 'tracking_id': False, + 'recipient': email, + 'partner_id': False, + 'isCc': True, + }) res[message.id] = partner_trackings return res diff --git a/mail_tracking/static/src/js/mail_tracking.js b/mail_tracking/static/src/js/mail_tracking.js index 84f0bed..3c98179 100644 --- a/mail_tracking/static/src/js/mail_tracking.js +++ b/mail_tracking/static/src/js/mail_tracking.js @@ -119,7 +119,6 @@ odoo.define('mail_tracking.partner_tracking', function(require){ _preprocess_message: function () { var msg = this._super.apply(this, arguments); msg.partner_trackings = msg.partner_trackings || []; - msg.email_cc = msg.email_cc || []; var needs_action = msg.track_needs_action; var message_track = _.findWhere(messages_tracked_changes, { id: msg.id, diff --git a/mail_tracking/static/src/xml/mail_tracking.xml b/mail_tracking/static/src/xml/mail_tracking.xml index 605ac9d..b8b66e3 100644 --- a/mail_tracking/static/src/xml/mail_tracking.xml +++ b/mail_tracking/static/src/xml/mail_tracking.xml @@ -5,39 +5,39 @@