Files
odoo_source/addons/survey/controllers
amdi-odoo 3de06d645d [FIX] survey: fix override answers
Purpose
=======
Fix the UserError which is raised when the user submits
an answer to a question having the "save as nickname" or
"save as email" option checked. In testing or non-testing mode.

Specifications
==============
When the question is marked as "save as email" or "save as nickname"
and when the user isn't public, the partner data is already saved
as the question answer (in the form of a user input line).
The answer is then pre-filled in the survey.
This is an issue because when the survey has the "users can go back"
option to False and the user tries to submit the answer, it thinks the
user is trying to changed the already saved user input line and it crashes
for security reasons.

In addition of allowing the answer override if the user can go back,
also allow the override if the question is marked as "save as nickname"
or "save as email".

This issue was introduced in 17.0 when the overwrite_existing optional
parameter has been added on the _save_lines method. Before that, the
existing user input lines were overwritten no matter what.

related odoo/odoo#129329

Task-3756749

closes odoo/odoo#155561

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-03-06 16:10:52 +00:00
..
…