diff options
| author | Romain Derie <rde@odoo.com> | 2020-02-21 17:18:44 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2020-02-24 14:44:58 +0000 |
| commit | 6898fec5a633a7a89759eb78d528dfceb0f6a8a0 (patch) | |
| tree | b3de1dee7f521d8552d7664085ebcbcfaebc71b7 /addons/website_forum/controllers | |
| parent | 64460c38ac9a73b458ad75b29278e439d9355380 (diff) | |
[FIX] website_forum: set website_id when created from frontend
Every records created from frontend should have the website_id set to the
current website.
Most was done with 066cfc9598a3, but forum was missing it.
Fixes #45749
closes odoo/odoo#46126
X-original-commit: 08540d7853d497e326182e822b359cd6fcb05d59
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Diffstat (limited to 'addons/website_forum/controllers')
| -rw-r--r-- | addons/website_forum/controllers/main.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 412a711730f..f8b268d902b 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -49,7 +49,11 @@ class WebsiteForum(WebsiteProfile): @http.route('/forum/new', type='json', auth="user", methods=['POST'], website=True) def forum_create(self, forum_name="New Forum", forum_mode="questions", add_menu=False): - forum_id = request.env['forum.forum'].create({'name': forum_name, 'mode': forum_mode}) + forum_id = request.env['forum.forum'].create({ + 'name': forum_name, + 'mode': forum_mode, + 'website_id': request.website.id, + }) if add_menu: request.env['website.menu'].create({ 'name': forum_name, |
