Browse Source

[REF] add "sent" parameter in data and simplify set_channel_flags() method in sent.js

pull/6/head
x620 9 years ago
parent
commit
28169ea7ed
  1. 9
      mail_sent/models.py
  2. 2
      mail_sent/static/src/js/sent.js

9
mail_sent/models.py

@ -16,6 +16,15 @@ class MailMessage(models.Model):
and self_sudo.author_id \
and self_sudo.partner_ids[0].id != self_sudo.author_id.id
@api.multi
def message_format(self):
message_values = super(MailMessage, self).message_format()
for message in message_values:
for item in self:
if message['id'] == item.id:
message['sent'] = item.sent
return message_values
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'

2
mail_sent/static/src/js/sent.js

@ -26,7 +26,7 @@ base_obj.MailTools.include({
set_channel_flags: function(data, msg){
this._super.apply(this, arguments);
if (_.contains(data.author_id, session.partner_id) && data.partner_ids.length > 0) {
if (data.sent) {
msg.is_sent = true;
}
return msg;

Loading…
Cancel
Save