summaryrefslogtreecommitdiff
path: root/addons/website_form/controllers/main.py
diff options
context:
space:
mode:
authorDeep Patel <dep@odoo.com>2017-08-04 18:48:23 +0530
committerJérome Maes <jem@openerp.com>2017-10-25 15:24:53 +0200
commiteb9d7f8b6f593db7900c3624dee210d156ef94ab (patch)
treea7a225342e15dbab53e44506c5eae7b3058fdc1b /addons/website_form/controllers/main.py
parent135823a4d8a7f65381f4e9c3dcebfdfde4423e71 (diff)
[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.
Diffstat (limited to 'addons/website_form/controllers/main.py')
-rw-r--r--addons/website_form/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
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,