[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
This commit is contained in:
Denis Ledoux
2015-12-23 14:35:07 +01:00
parent ed6a52a517
commit 9c2836090f
+1 -1
View File
@@ -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,