|
|
@ -35,7 +35,20 @@ base_obj.MailTools.include({ |
|
|
|
|
|
|
|
set_channel_flags: function(data, msg){ |
|
|
|
this._super.apply(this, arguments); |
|
|
|
// Get recipients ids
|
|
|
|
var recipients_ids = []; |
|
|
|
for (var i = 0; i < data.partner_ids.length; i++){ |
|
|
|
recipients_ids.push(data.partner_ids[i][0]); |
|
|
|
} |
|
|
|
|
|
|
|
// If author or recipient
|
|
|
|
if ( |
|
|
|
(data.sent && data.author_id[0] == session.partner_id) |
|
|
|
|| (recipients_ids.indexOf(session.partner_id) != -1) |
|
|
|
) { |
|
|
|
msg.is_archive = true; |
|
|
|
} |
|
|
|
|
|
|
|
return msg; |
|
|
|
}, |
|
|
|
|
|
|
@ -45,7 +58,11 @@ base_obj.MailTools.include({ |
|
|
|
}, |
|
|
|
|
|
|
|
get_domain: function(channel){ |
|
|
|
return (channel.id === "channel_archive") ? [] : this._super.apply(this, arguments); |
|
|
|
return (channel.id === "channel_archive") ? [ |
|
|
|
'|', ['partner_ids', 'in', [openerp.session.partner_id]], |
|
|
|
'&', ['sent', '=', true], |
|
|
|
['author_id.user_ids', 'in', [openerp.session.uid]] |
|
|
|
] : this._super.apply(this, arguments); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|