Skip to content
Snippets Groups Projects
Commit c6c7605c authored by Swapnesh Shah's avatar Swapnesh Shah Committed by Thibault Delavallée
Browse files

[FIX] survey: do not always get answer_score


Calling `_get_answer_score_values` on each question creation or update is
not necessary if value is already provided.

Followup of odoo/odoo@0d32ed45aebe2721073580ddae68ec4a8c1499d6

closes odoo/odoo#68500

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 29cd0492
No related branches found
No related tags found
No related merge requests found
......@@ -529,8 +529,8 @@ class SurveyUserInputLine(models.Model):
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
score_vals = self._get_answer_score_values(vals)
if not vals.get('answer_score'):
score_vals = self._get_answer_score_values(vals)
vals.update(score_vals)
return super(SurveyUserInputLine, self).create(vals_list)
......@@ -544,8 +544,8 @@ class SurveyUserInputLine(models.Model):
'question_id': line.question_id.id,
**vals_copy
}
score_vals = self._get_answer_score_values(getter_params, compute_speed_score=False)
if not vals_copy.get('answer_score'):
score_vals = self._get_answer_score_values(getter_params, compute_speed_score=False)
vals_copy.update(score_vals)
res = super(SurveyUserInputLine, line).write(vals_copy) and res
return res
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment