[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user