diff --git a/addons/survey/controllers/survey_session_manage.py b/addons/survey/controllers/survey_session_manage.py index ed84444f5b5..c0935e7a7d7 100644 --- a/addons/survey/controllers/survey_session_manage.py +++ b/addons/survey/controllers/survey_session_manage.py @@ -46,6 +46,8 @@ class UserInputSession(http.Controller): - If the state of the session is 'ready' We render a template allowing the host to showcase the different options of the session and to actually start the session. + If there are no questions, a "void content" is displayed instead to avoid displaying a + blank survey. - If the state of the session is 'in_progress' We render a template allowing the host to show the question results, display the attendees leaderboard or go to the next question of the session. """ @@ -57,6 +59,11 @@ class UserInputSession(http.Controller): return NotFound() if survey.session_state == 'ready': + if not survey.question_ids: + return request.render('survey.survey_void_content', { + 'survey': survey, + 'answer': request.env['survey.user_input'], + }) return request.render('survey.user_input_session_open', { 'survey': survey }) diff --git a/addons/survey/views/survey_templates_management.xml b/addons/survey/views/survey_templates_management.xml index 43007393713..f5aff7caff1 100644 --- a/addons/survey/views/survey_templates_management.xml +++ b/addons/survey/views/survey_templates_management.xml @@ -27,12 +27,16 @@
-

survey is void

-

Please make sure you have at least one question in your survey. You also need at least one section if you chose the "Page per section" layout.
+

survey is empty

+

+ Please make sure you have at least one question in your survey. You also need at least one section if you chose the "Page per section" layout.
Edit in backend

+

+ No question yet, come back later. +