diff options
Diffstat (limited to 'addons/mail/controllers/main.py')
| -rw-r--r-- | addons/mail/controllers/main.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index 959877ad098..c2e15c4a12f 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -3,15 +3,16 @@ import psycopg2 import openerp from openerp import SUPERUSER_ID -import openerp.addons.web.http as http +from openerp import http 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: @@ -20,10 +21,10 @@ class MailController(http.Controller): if filecontent and filename: return req.make_response(filecontent, headers=[('Content-Type', 'application/octet-stream'), - ('Content-Disposition', content_disposition(filename, req))]) + ('Content-Disposition', content_disposition(filename))]) 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') |
