From eb9d7f8b6f593db7900c3624dee210d156ef94ab Mon Sep 17 00:00:00 2001 From: Deep Patel Date: Fri, 4 Aug 2017 18:48:23 +0530 Subject: [PATCH] [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. --- addons/website_form/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_form/controllers/main.py b/addons/website_form/controllers/main.py index fd42ef8da0b..9493f15a17b 100644 --- a/addons/website_form/controllers/main.py +++ b/addons/website_form/controllers/main.py @@ -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,