|
@ -71,15 +71,16 @@ class SurveyUserInput(models.Model): |
|
|
'answer_type': answer_type, |
|
|
'answer_type': answer_type, |
|
|
} |
|
|
} |
|
|
if answer_type == 'upload_file': |
|
|
if answer_type == 'upload_file': |
|
|
file_data = answer[0] |
|
|
|
|
|
file_name = answer[1] |
|
|
|
|
|
attachment_ids = [] |
|
|
attachment_ids = [] |
|
|
for file in range(len(answer[1])): |
|
|
if len(answer) >= 2: |
|
|
attachment = self.env['ir.attachment'].create({ |
|
|
file_data = answer[0] |
|
|
'name': file_name[file], |
|
|
file_name = answer[1] |
|
|
'type': 'binary', |
|
|
for file in range(len(answer[1])): |
|
|
'datas': file_data[file], |
|
|
attachment = self.env['ir.attachment'].create({ |
|
|
}) |
|
|
'name': file_name[file], |
|
|
attachment_ids.append(attachment.id) |
|
|
'type': 'binary', |
|
|
|
|
|
'datas': file_data[file], |
|
|
|
|
|
}) |
|
|
|
|
|
attachment_ids.append(attachment.id) |
|
|
vals['value_file_data_ids'] = attachment_ids |
|
|
vals['value_file_data_ids'] = attachment_ids |
|
|
return vals |
|
|
return vals |
|
|