[FIX] website_forum: add name get on forum.post #4364

When comment is created, emails are sent with subject: "Re: False" and footer: "About Forum False".
Now, when the post is a comment, we fallback to the name of the parent (the main forum post).
This commit is contained in:
Jeremy Kersten 2015-01-12 15:10:44 +01:00
parent be8ee97c44
commit 0de1d89648
1 changed files with 9 additions and 0 deletions

View File

@ -346,6 +346,15 @@ class Post(osv.Model):
'child_ids': list(),
}
def name_get(self, cr, uid, ids, context=None):
result = []
for post in self.browse(cr, uid, ids, context=context):
if post.parent_id and not post.name:
result.append((post.id, '%s (%s)' % (post.parent_id.name, post.id)))
else:
result.append((post.id, '%s' % (post.name)))
return result
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}