diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index 959877ad098..054e6eadd1e 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -10,8 +10,9 @@ from openerp.addons.web.controllers.main import content_disposition class MailController(http.Controller): _cp_path = '/mail' - @http.httprequest + @http.route('/mail/download_attachment', type='http', auth='user') def download_attachment(self, req, model, id, method, attachment_id, **kw): + # FIXME use /web/binary/saveas directly Model = req.session.model(model) res = getattr(Model, method)(int(id), int(attachment_id)) if res: @@ -23,7 +24,7 @@ class MailController(http.Controller): ('Content-Disposition', content_disposition(filename, req))]) return req.not_found() - @http.jsonrequest + @http.route('/mail/receive', type='json', auth='none') def receive(self, req): """ End-point to receive mail from an external SMTP server. """ dbs = req.jsonrequest.get('databases')