[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:
parent
c372708b01
commit
9fe930e6ba
|
@ -1171,7 +1171,7 @@ class survey_user_input_line(osv.Model):
|
||||||
if old_uil:
|
if old_uil:
|
||||||
self.unlink(cr, SUPERUSER_ID, old_uil, context=context)
|
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()
|
comment_answer = ca.pop(("%s_%s" % (answer_tag, 'comment')), '').strip()
|
||||||
if len(ca) > 0:
|
if len(ca) > 0:
|
||||||
for a in ca:
|
for a in ca:
|
||||||
|
@ -1203,7 +1203,7 @@ class survey_user_input_line(osv.Model):
|
||||||
self.unlink(cr, SUPERUSER_ID, old_uil, context=context)
|
self.unlink(cr, SUPERUSER_ID, old_uil, context=context)
|
||||||
|
|
||||||
no_answers = True
|
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()
|
comment_answer = ca.pop(("%s_%s" % (answer_tag, 'comment')), '').strip()
|
||||||
if comment_answer:
|
if comment_answer:
|
||||||
|
|
Loading…
Reference in New Issue