[IMP] website_form: name of submitted attachments

In case of custom field 'upload file', the attachement
name will be the technical name of the input tag of the
form (aka 'attachments'). It is more user friendly to have
the name of the uploaded file.
This commit is contained in:
Deep Patel
2017-10-25 15:24:53 +02:00
committed by Jérome Maes
parent 135823a4d8
commit eb9d7f8b6f
+1 -1
View File
@@ -206,7 +206,7 @@ class WebsiteForm(http.Controller):
for file in files:
custom_field = file.field_name not in authorized_fields
attachment_value = {
'name': file.field_name if custom_field else file.filename,
'name': file.filename,
'datas': base64.encodestring(file.read()),
'datas_fname': file.filename,
'res_model': model.model,