From eb45f84128124fffb18e893043fc2882419d5ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Warnon?= Date: Wed, 27 Feb 2019 15:18:48 +0000 Subject: [PATCH] [FIX] survey: fix invitation sending with no page_ids Puprose ======= This commit fixes the survey to allow sending invitation even if the survey has no pages as long as the questions_layout is 'page_per_question'. --- addons/survey/models/survey_survey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/models/survey_survey.py b/addons/survey/models/survey_survey.py index e486ef9a41c..a6b106e1531 100644 --- a/addons/survey/models/survey_survey.py +++ b/addons/survey/models/survey_survey.py @@ -434,7 +434,7 @@ class Survey(models.Model): def action_send_survey(self): """ Open a window to compose an email, pre-filled with the survey message """ # Ensure that this survey has at least one page with at least one question. - if not self.page_ids or not [page.question_ids for page in self.page_ids if page.question_ids]: + if (not self.page_ids and self.questions_layout != 'page_per_question') or not self.question_ids: raise UserError(_('You cannot send an invitation for a survey that has no questions.')) if self.stage_id.closed: