summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraetna-softwares <aetna.softwares@gmail.com>2016-05-30 09:27:46 +0200
committerRichard Mathot <rim@odoo.com>2016-07-29 11:13:08 +0200
commit9fe930e6ba95a223fc56163d675e8d5a6485a6fc (patch)
tree8706f10ffc0b7778f5ffc6b71e477c4e337af012
parentc372708b01b9c1a19137b25eeddf6ec7ab2c2480 (diff)
[FIX] survey: prevent saving issues of answers to multiple_choice questions, when id starts with id of other questions
Fixes #11873 #12215
-rw-r--r--addons/survey/survey.py4
1 files 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: