diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 55e8b89e5dc..e5bae72eb00 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -84,12 +84,12 @@ class crm_lead(base_stage, format_address, osv.osv): }, } - def dynamic_help(self, cr, uid, help, context=None): + def get_empty_list_help(self, cr, uid, help, context=None): if context.get('default_type', None) == 'lead': - context['dynamic_help_model'] = 'crm.case.section' - context['dynamic_help_id'] = context.get('default_section_id', None) - context['dynamic_help_documents'] = _("leads") - return super(crm_lead, self).dynamic_help(cr, uid, help, context=context) + context['empty_list_help_model'] = 'crm.case.section' + context['empty_list_help_id'] = context.get('default_section_id', None) + context['empty_list_help_document_name'] = _("leads") + return super(crm_lead, self).get_empty_list_help(cr, uid, help, context=context) def onchange_user_id(self, cr, uid, ids, section_id, user_id, context=None): if user_id: diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index d2580580af0..b0b60db6bd5 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -487,11 +487,11 @@ class hr_applicant(base_stage, osv.Model): """ return self.set_priority(cr, uid, ids, '3') - def dynamic_help(self, cr, uid, help, context=None): - context['dynamic_help_model'] = 'hr.job' - context['dynamic_help_id'] = context.get('default_job_id', None) - context['dynamic_help_documents'] = _("job applicants") - return super(hr_applicant, self).dynamic_help(cr, uid, help, context=context) + def get_empty_list_help(self, cr, uid, help, context=None): + context['empty_list_help_model'] = 'hr.job' + context['empty_list_help_id'] = context.get('default_job_id', None) + context['empty_list_help_document_name'] = _("job applicants") + return super(hr_applicant, self).get_empty_list_help(cr, uid, help, context=context) class hr_job(osv.osv): diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index c37a22d88f5..1c4688aa21d 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -89,14 +89,14 @@ class mail_thread(osv.AbstractModel): # :param function lambda: returns whether the tracking should record using this subtype _track = {} - def dynamic_help(self, cr, uid, help, context=None): - if not context.get('dynamic_help_model', None): - if context.get('dynamic_help_id', None): - object_id = self.pool.get(context.get('dynamic_help_model')).browse(cr, uid, context.get('dynamic_help_id'), context=context) + def get_empty_list_help(self, cr, uid, help, context=None): + if not context.get('empty_list_help_model', None): + if context.get('empty_list_help_id', None): + object_id = self.pool.get(context.get('empty_list_help_model')).browse(cr, uid, context.get('empty_list_help_id'), context=context) 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 here to add a new %s or send an email to: %s

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

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

") % (context.get('empty_list_help_document_name', _("documents")), email, email), help or "") else: model_id = self.pool.get('ir.model').search(cr, uid, [("model", "=", self._name)], context=context)[0] alias_obj = self.pool.get('mail.alias') @@ -104,10 +104,10 @@ 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 here to add a new %s or send an email, for example, to: %s

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

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

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

Click here to add a new %s

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

Click here to add a new %s

") % context.get('empty_list_help_document_name', _("documents")), help or "") return help diff --git a/addons/project/project.py b/addons/project/project.py index 770a986d1b6..eba05921d46 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -889,11 +889,11 @@ class task(base_stage, osv.osv): return res - def dynamic_help(self, cr, uid, help, context=None): - context['dynamic_help_model'] = 'project.project' - context['dynamic_help_id'] = context.get('default_project_id', None) - context['dynamic_help_documents'] = _("tasks") - return super(task, self).dynamic_help(cr, uid, help, context=context) + def get_empty_list_help(self, cr, uid, help, context=None): + context['empty_list_help_model'] = 'project.project' + context['empty_list_help_id'] = context.get('default_project_id', None) + context['empty_list_help_document_name'] = _("tasks") + return super(task, self).get_empty_list_help(cr, uid, help, context=context) # ---------------------------------------- # Case management diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index e89c8379a69..ffbed80aea5 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -412,11 +412,11 @@ class project_issue(base_stage, osv.osv): self.write(cr, uid, ids, {'date_open': False, 'date_closed': False}) return res - def dynamic_help(self, cr, uid, help, context=None): - context['dynamic_help_model'] = 'project.project' - context['dynamic_help_id'] = context.get('default_project_id', None) - context['dynamic_help_documents'] = _("issues") - return super(project_issue, self).dynamic_help(cr, uid, help, context=context) + def get_empty_list_help(self, cr, uid, help, context=None): + context['empty_list_help_model'] = 'project.project' + context['empty_list_help_id'] = context.get('default_project_id', None) + context['empty_list_help_document_name'] = _("issues") + return super(project_issue, self).get_empty_list_help(cr, uid, help, context=context) # ------------------------------------------------------- # Stage management