diff options
| author | Paul Morelle <pmo@odoo.com> | 2020-02-12 09:47:53 +0000 |
|---|---|---|
| committer | Paul Morelle <pmo@odoo.com> | 2020-02-12 13:16:47 +0000 |
| commit | 0cc95583bfcc96c428a527742a86e0d1bc497bf9 (patch) | |
| tree | f1eb9254ea4676c9f74fdaa3d54192e3a24fb236 /addons | |
| parent | 58c4f8ffc1e4eee3b87e2de269f9732e5d8ab293 (diff) | |
[FIX] website_forum: give a name to posts created from comments
From Odoo 13.0, the list of answers of a user displays the name of the
answer itself, and not its parent's.
Answers created directly on a question are given a name, but answers
created from a comment are not.
This commit fixes this behavior for a better consistancy: all posts
should have a displayable name.
A migration step on saas~12.5 will populate from their parent's name
the existing posts that don't have a name.
closes odoo/odoo#45193
X-original-commit: 327079e97d12bf3bfcbc74e78bcc7ebc36149d02
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website_forum/models/forum.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index b21845bfd92..4e0ba27fa61 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -761,6 +761,7 @@ class Post(models.Model): 'forum_id': question.forum_id.id, 'content': comment.body, 'parent_id': question.id, + 'name': _('Re: %s') % (question.name or ''), } # done with the author user to have create_uid correctly set new_post = self.with_user(post_create_uid).create(post_values) |
