[FIX] project, mail: improved empty list message

This commit is contained in:
Fabien Pinckaers
2018-02-04 17:06:52 +01:00
parent 8368f09858
commit e02e7517b3
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -332,14 +332,14 @@ class MailThread(models.AbstractModel):
if nothing_here:
return "<p class='o_view_nocontent_smiling_face'>%(dyn_help)s</p>%(static_help)s" % {
'static_help': help or '',
'dyn_help': _("Add new %(document)s or send an email to: %(email_link)s") % {
'dyn_help': _("Add new %(document)s or send an email to %(email_link)s") % {
'document': document_name,
'email_link': email_link
}
}
return "%(static_help)s<p>%(dyn_help)s</p>" % {
'static_help': help or '',
'dyn_help': _("You could also add a new %(document)s by sending an email to: %(email_link)s") % {
'dyn_help': _("Create a new %(document)s by sending an email to %(email_link)s") % {
'document': document_name,
'email_link': email_link,
}
+7 -1
View File
@@ -682,10 +682,16 @@ class Task(models.Model):
@api.model
def get_empty_list_help(self, help):
tname = _("task")
project_id = self.env.context.get('default_project_id', False)
if project_id:
name = self.env['project.project'].browse(project_id).label_tasks
if name: tname = name.lower()
self = self.with_context(
empty_list_help_id=self.env.context.get('default_project_id'),
empty_list_help_model='project.project',
empty_list_help_document_name=_("task"),
empty_list_help_document_name=tname,
)
return super(Task, self).get_empty_list_help(help)