From b2c74f5f424be8c59e7e599b8cbfd035e22c27a4 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 15 Oct 2013 17:36:31 +0200 Subject: [PATCH] [FIX] mail: use @route decorator for routes bzr revid: chs@openerp.com-20131015153631-18pdi1xzk84kg1y2 --- addons/mail/controllers/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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')