[FIX] mail: fix _get_default_from if no alias_name for user.

As alias_name is not anymore required, we should check that the alias_domain AND alias_name are set before choosing the alias as email_from of the mail.message

bzr revid: dle@openerp.com-20131220115213-ll8duh01csk0xy4t
This commit is contained in:
Denis Ledoux 2013-12-20 12:52:13 +01:00
parent d7b1dafbab
commit abefabfa3e
1 changed files with 1 additions and 1 deletions

View File

@ -201,7 +201,7 @@ class mail_message(osv.Model):
def _get_default_from(self, cr, uid, context=None):
this = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context)
if this.alias_domain:
if this.alias_name and this.alias_domain:
return '%s <%s@%s>' % (this.name, this.alias_name, this.alias_domain)
elif this.email:
return '%s <%s>' % (this.name, this.email)