diff options
| author | Jeremy Kersten <jke@odoo.com> | 2015-01-12 15:10:44 +0100 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2015-01-12 15:27:32 +0100 |
| commit | 0de1d896482e24dbe69a0e00a7e753d72b5c082a (patch) | |
| tree | 56028d34f9946c564054c9a04efd5505529563ba | |
| parent | be8ee97c447b40d163c0be4a7a4457b8e270e3cd (diff) | |
[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).
| -rw-r--r-- | addons/website_forum/models/forum.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index dcae413a8e5..95343de4af6 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -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 = {} |
