[FIX] survey: prevent saving issues of answers to multiple_choice questions, when id starts with id of other questions

Fixes #11873 #12215
This commit is contained in:
aetna-softwares
2016-07-29 11:13:08 +02:00
committed by Richard Mathot
parent c372708b01
commit 9fe930e6ba
+2 -2
View File
@@ -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: