[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:
parent
44d189fd9f
commit
b8214efe45
|
@ -175,7 +175,7 @@ class mail_alias(osv.Model):
|
||||||
registry = RegistryManager.get(cr.dbname)
|
registry = RegistryManager.get(cr.dbname)
|
||||||
mail_alias = registry.get('mail.alias')
|
mail_alias = registry.get('mail.alias')
|
||||||
child_class_model = registry[child_model_name]
|
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
|
# 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]):
|
for obj_data in child_class_model.read(cr, SUPERUSER_ID, no_alias_ids, [alias_key]):
|
||||||
alias_vals = {'alias_name': False}
|
alias_vals = {'alias_name': False}
|
||||||
|
|
|
@ -71,7 +71,7 @@ class mail_mail(osv.Model):
|
||||||
|
|
||||||
def _get_default_from(self, cr, uid, context=None):
|
def _get_default_from(self, cr, uid, context=None):
|
||||||
this = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context)
|
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)
|
return '%s <%s@%s>' % (this.name, this.alias_name, this.alias_domain)
|
||||||
elif this.email:
|
elif this.email:
|
||||||
return '%s <%s>' % (this.name, this.email)
|
return '%s <%s>' % (this.name, this.email)
|
||||||
|
|
Loading…
Reference in New Issue