From f029bf71d064c147842cf044d24e105f13b894ab Mon Sep 17 00:00:00 2001 From: David Beguin Date: Wed, 6 Mar 2019 11:18:14 +0000 Subject: [PATCH] [IMP] website_slides_forum : allow to create a forum and to comment on course frontend creation When creating a course via the frontend, the behaviour with forum and comment should be the same than from backend. The website_publisher can decide to create or not a forum linked to this course and decide independantely to allow the review and comment on that course. Commit linked to task ID 1941250 and PR #31584. --- .../website_slides_forum/controllers/main.py | 13 +++----- .../src/xml/website_slides_forum_channel.xml | 32 +++++-------------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/addons/website_slides_forum/controllers/main.py b/addons/website_slides_forum/controllers/main.py index 052df5f4de2..2331f11ca46 100644 --- a/addons/website_slides_forum/controllers/main.py +++ b/addons/website_slides_forum/controllers/main.py @@ -8,15 +8,12 @@ from odoo.addons.website_slides.controllers.main import WebsiteSlides class WebsiteSlidesForum(WebsiteSlides): def _slide_channel_prepare_values(self, **kwargs): - communication_type = kwargs.get('communication_type') channel = super(WebsiteSlidesForum, self)._slide_channel_prepare_values(**kwargs) - if communication_type: - if communication_type == 'forum': - forum = request.env['forum.forum'].create({ - 'name': kwargs.get('name') - }) - channel['forum_id'] = forum.id - channel['allow_comment'] = communication_type == 'comment' + if bool(kwargs.get('link_forum')): + forum = request.env['forum.forum'].create({ + 'name': kwargs.get('name') + }) + channel['forum_id'] = forum.id return channel # Profile diff --git a/addons/website_slides_forum/static/src/xml/website_slides_forum_channel.xml b/addons/website_slides_forum/static/src/xml/website_slides_forum_channel.xml index 03389f2a12d..f00c7e4e0ba 100644 --- a/addons/website_slides_forum/static/src/xml/website_slides_forum_channel.xml +++ b/addons/website_slides_forum/static/src/xml/website_slides_forum_channel.xml @@ -1,32 +1,16 @@ - -
-
- Communication -
-
- - -
-
- - -
-
- - -
+ +
+
Communication
+
+
+ +
-
+