[FIX] mail: email_from does not take alias into account if it is False.é

bzr revid: tde@openerp.com-20130516112425-n3qq2lm509qa8hy5
This commit is contained in:
Thibault Delavallée 2013-05-16 13:24:25 +02:00
parent 44d189fd9f
commit b8214efe45
2 changed files with 2 additions and 2 deletions

View File

@ -175,7 +175,7 @@ class mail_alias(osv.Model):
registry = RegistryManager.get(cr.dbname)
mail_alias = registry.get('mail.alias')
child_class_model = registry[child_model_name]
no_alias_ids = child_class_model.search(cr, SUPERUSER_ID, [('alias_id', '=', False)], context={'active_test':False})
no_alias_ids = child_class_model.search(cr, SUPERUSER_ID, [('alias_id', '=', False)], context={'active_test': False})
# Use read() not browse(), to avoid prefetching uninitialized inherited fields
for obj_data in child_class_model.read(cr, SUPERUSER_ID, no_alias_ids, [alias_key]):
alias_vals = {'alias_name': False}

View File

@ -71,7 +71,7 @@ class mail_mail(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_domain and this.alias_name:
return '%s <%s@%s>' % (this.name, this.alias_name, this.alias_domain)
elif this.email:
return '%s <%s>' % (this.name, this.email)