From 9c2836090fa1725e9ff3b53adbbb1533b8609f15 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 23 Dec 2015 14:30:51 +0100 Subject: [PATCH] [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 --- addons/website_forum/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,