From 6bfb7801aee44b9eec825bdea45d8c91af788de4 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 20 Mar 2013 14:41:16 +0100 Subject: [PATCH] [IMP] mail: dynamic_help bzr revid: chm@openerp.com-20130320134116-6drwq1wd0u11x77m --- addons/mail/mail_thread.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index d61ce4d0582..ff7a641a5e3 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -98,7 +98,7 @@ class mail_thread(osv.AbstractModel): alias = object_id.alias_id and object_id.alias_id.name_get() or False if alias and alias[0] and alias[0][1]: email = alias[0][1] - return "%s %s" % (_("

Click to add a new %s or create this by sending an email to: %s

" % (context.get('dynamic_help_documents', _("documents")), email, email)), help) + return "%s %s" % (_("

Click here to add a new %s or send an email to: %s

") % (context.get('dynamic_help_documents', _("documents")), email, email), help) else: model_id = self.pool.get('ir.model').search(cr, uid, [("model", "=", self._name)], context=context)[0] alias_obj = self.pool.get('mail.alias') @@ -106,7 +106,11 @@ class mail_thread(osv.AbstractModel): if alias_ids: for alias in alias_obj.browse(cr, uid, alias_ids, context=context): email = "%s@%s" % (alias.alias_name, alias.alias_domain) - return "%s %s" % (_("

Click to add a new %s or create this by sending an email, for example to: %s

" % (context.get('dynamic_help_documents', _("documents")), email, email)), help) + return "%s %s" % (_("

Click here to add a new %s or send an email, for example, to: %s

") % (context.get('dynamic_help_documents', _("documents")), email, email), help) + + if help.find("oe_view_nocontent_create") == -1: + return "%s %s" % (_("

Click here to add a new %s

") % context.get('dynamic_help_documents', _("documents")), help) + return help def _get_message_data(self, cr, uid, ids, name, args, context=None):