[FIX] mail: suggested recipient for emails without author

When a message had no author (this is accepted),
a recipient without full_name, name and email address
was added to the suggested recipients of the thread,
leading to a "(no email address)" within the suggested recipients,
which is not really useful.

opw-629797
This commit is contained in:
Denis Ledoux 2015-03-10 11:33:04 +01:00
parent 1fe4cef530
commit 9e4a8e814f
1 changed files with 2 additions and 1 deletions

View File

@ -800,7 +800,8 @@ openerp.mail = function (session) {
_.each(messages, function (thread) {
if (thread.author_id && !thread.author_id[0] &&
!_.find(self.recipients, function (recipient) {return recipient.email_address == thread.author_id[3];})) {
!_.find(self.recipients, function (recipient) {return recipient.email_address == thread.author_id[3];}) &&
_.some([thread.author_id[1], thread.author_id[2], thread.author_id[3]])) {
self.recipients.push({ 'full_name': thread.author_id[1],
'name': thread.author_id[2],
'email_address': thread.author_id[3],