From c41cc328bba0b7eafb697a01b7a379b348eafa9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 5 Apr 2013 13:58:30 +0200 Subject: [PATCH] [IMP] mail_thread: in empty list help, do not display alias info when alias domain is not configured. bzr revid: tde@openerp.com-20130405115830-wv64k3z20t8m1odx --- addons/mail/mail_thread.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 2799d5213c2..7ca9fcb7b53 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -94,13 +94,15 @@ class mail_thread(osv.AbstractModel): that adds alias information. """ model = context.get('empty_list_help_model') res_id = context.get('empty_list_help_id') + ir_config_parameter = self.pool.get("ir.config_parameter") + catchall_domain = ir_config_parameter.get_param(cr, uid, "mail.catchall.domain", context=context) document_name = context.get('empty_list_help_document_name', _('document')) alias = None - if model and res_id: # specific res_id -> find its alias (i.e. section_id specified) + if catchall_domain and model and res_id: # specific res_id -> find its alias (i.e. section_id specified) object_id = self.pool.get(model).browse(cr, uid, res_id, context=context) alias = object_id.alias_id - elif model: # no specific res_id given -> generic help message, take an example alias (i.e. alias of some section_id) + elif catchall_domain and model: # no specific res_id given -> generic help message, take an example alias (i.e. alias of some section_id) model_id = self.pool.get('ir.model').search(cr, uid, [("model", "=", self._name)], context=context)[0] alias_obj = self.pool.get('mail.alias') alias_ids = alias_obj.search(cr, uid, [("alias_model_id", "=", model_id)], context=context, limit=1, order='id ASC')