[FIX]survey_record_generation:fix IndexError when record value is empty
This commit is contained in:
@@ -11,7 +11,7 @@ Allow to create record of any model when sending the form :
|
||||
* Associate question with fields
|
||||
* For x2m fields : Associate values to questions
|
||||
""",
|
||||
"version": "16.0.1.0.1",
|
||||
"version": "16.0.1.0.2",
|
||||
"license": "AGPL-3",
|
||||
"author": "Elabore",
|
||||
"website": "https://www.elabore.coop",
|
||||
|
||||
@@ -59,7 +59,10 @@ class SurveyUserInput(models.Model):
|
||||
if user_input_line.suggested_answer_id and user_input_line.suggested_answer_id.record_id:
|
||||
record_ids.append(user_input_line.suggested_answer_id.record_id.id)
|
||||
if field_value.question_id.question_type == 'simple_choice':
|
||||
vals[field_value.field_id.name] = record_ids[0]
|
||||
if record_ids:
|
||||
vals[field_value.field_id.name] = record_ids[0]
|
||||
else:
|
||||
vals[field_value.field_id.name] = None
|
||||
else:
|
||||
vals[field_value.field_id.name] = record_ids
|
||||
if field_value.question_id.answer_values_type == 'value':
|
||||
|
||||
Reference in New Issue
Block a user