From 19e556b34fbc770007a9e44607466209010311e4 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 17 Aug 2016 13:43:23 +0200 Subject: [FIX] website_form: traceback when sending an attachment The form builder offers the possibility to add a "Custom File Upload" field. When the user clicks on "Send", an error occurs ("An error has occured, the form has not been sent."). This is because we try to send a mail linked to "mail.mail", which doesn't make sense. The case was actually taken into account in the code, there was just an oversight in the code. opw-684040 --- addons/website_form/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website_form/controllers') diff --git a/addons/website_form/controllers/main.py b/addons/website_form/controllers/main.py index e6ebeaef4b2..ee8a7b37ced 100644 --- a/addons/website_form/controllers/main.py +++ b/addons/website_form/controllers/main.py @@ -215,7 +215,7 @@ class WebsiteForm(http.Controller): # If some attachments didn't match a field on the model, # we create a mail.message to link them to the record if orphan_attachment_ids: - if model.name != 'mail.mail': + if model.model != 'mail.mail': values = { 'body': _('

Attached files :

'), 'model': model.model, -- cgit v1.2.3