From 9fe930e6ba95a223fc56163d675e8d5a6485a6fc Mon Sep 17 00:00:00 2001 From: aetna-softwares Date: Mon, 30 May 2016 09:27:46 +0200 Subject: [PATCH] [FIX] survey: prevent saving issues of answers to multiple_choice questions, when id starts with id of other questions Fixes #11873 #12215 --- addons/survey/survey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index a29e24e79d9..f428ba58a5d 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -1171,7 +1171,7 @@ class survey_user_input_line(osv.Model): if old_uil: self.unlink(cr, SUPERUSER_ID, old_uil, context=context) - ca = dict_keys_startswith(post, answer_tag) + ca = dict_keys_startswith(post, answer_tag+"_") comment_answer = ca.pop(("%s_%s" % (answer_tag, 'comment')), '').strip() if len(ca) > 0: for a in ca: @@ -1203,7 +1203,7 @@ class survey_user_input_line(osv.Model): self.unlink(cr, SUPERUSER_ID, old_uil, context=context) no_answers = True - ca = dict_keys_startswith(post, answer_tag) + ca = dict_keys_startswith(post, answer_tag+"_") comment_answer = ca.pop(("%s_%s" % (answer_tag, 'comment')), '').strip() if comment_answer: