From 09237efa33323d5d49ed7182eede882fa0975148 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 6 Feb 2017 16:14:24 +0100 Subject: [PATCH] [FIX] survey: validate_multiple_choice with comments allowed When validating a multiple choice with comments allowed, the comment was popped from answer_candidates and then the condition to prevent answers with blank value always triggered an error. opw:707072 --- addons/survey/models/survey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/models/survey.py b/addons/survey/models/survey.py index d4d20c915eb..e40e8d29235 100644 --- a/addons/survey/models/survey.py +++ b/addons/survey/models/survey.py @@ -637,7 +637,7 @@ class SurveyQuestion(models.Model): if self.comments_allowed: comment_answer = answer_candidates.pop(("%s_%s" % (answer_tag, 'comment')), '').strip() # Preventing answers with blank value - if all([True if not answer.strip() else False for answer in answer_candidates.values()]): + if all([True if not answer.strip() else False for answer in answer_candidates.values()]) and answer_candidates: errors.update({answer_tag: self.constr_error_msg}) # There is no answer neither comments (if comments count as answer) if not answer_candidates and self.comment_count_as_answer and (not comment_flag or not comment_answer):