summaryrefslogtreecommitdiff
path: root/addons/website_forum/controllers/main.py
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-12-23 14:30:51 +0100
committerDenis Ledoux <dle@odoo.com>2015-12-23 14:35:07 +0100
commit9c2836090fa1725e9ff3b53adbbb1533b8609f15 (patch)
tree27f594e53a13b022f89be81570168a3bf6fccf91 /addons/website_forum/controllers/main.py
parented6a52a5177349d41f2a589596d9ddfc312b8dff (diff)
[FIX] website_forum: set a name for answers
When replying to a question, there is no possibility to set a title (`name`) in the answer form, there is no input for the title, even if the controller `/reply` would accept it. This revision sets a title for answers so: - The answers doesn't appear as `False` in the breadcrumb - The subject of the mail notifications sent for these answers are set with a meaningful title opw-659279
Diffstat (limited to 'addons/website_forum/controllers/main.py')
-rw-r--r--addons/website_forum/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py
index 1f982328db6..a12bbfc85b0 100644
--- a/addons/website_forum/controllers/main.py
+++ b/addons/website_forum/controllers/main.py
@@ -324,7 +324,7 @@ class WebsiteForum(http.Controller):
post_tag_ids = forum._tag_to_write_vals(post.get('post_tags', ''))
new_question = request.env['forum.post'].create({
'forum_id': forum.id,
- 'name': post.get('post_name', ''),
+ 'name': post.get('post_name') or (post_parent and 'Re: %s' % (post_parent.name or '')) or '',
'content': post.get('content', False),
'content_link': post.get('content_link', False),
'parent_id': post_parent and post_parent.id or False,