[IMP] web: move controler download_attachment into mail. change render into _t

bzr revid: chm@openerp.com-20121211144551-9uryi1z1sxe9daxv
This commit is contained in:
Christophe Matthieu
2012-12-11 15:45:51 +01:00
parent 5944b6c6d6
commit f817cd3f38
3 changed files with 1 additions and 16 deletions
-13
View File
@@ -1245,19 +1245,6 @@ class Binary(openerpweb.Controller):
[('Content-Type', 'application/octet-stream'),
('Content-Disposition', content_disposition(filename, req))])
@openerpweb.httprequest
def download_attachment(self, req, model, id, method, attachment_id, **kw):
Model = req.session.model(model)
res = getattr(Model, method)(int(id), int(attachment_id))
if res:
filecontent = base64.b64decode(res.get('base64'))
filename = res.get('filename')
if filecontent and filename:
return req.make_response(filecontent,
headers=[('Content-Type', 'application/octet-stream'),
('Content-Disposition', content_disposition(filename, req))])
return req.not_found()
@openerpweb.httprequest
def saveas_ajax(self, req, data, token):
jdata = simplejson.loads(data)
+1 -1
View File
@@ -5124,7 +5124,7 @@ instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractFie
// TODO : activate send on wizard and form
if (result.error || !result.id ) {
this.do_warn( instance.web.qweb.render('message_error_uploading'), result.error);
this.do_warn( _t('Uploading error'), result.error);
files = _.filter(files, function (val) { return !val.upload; });
} else {
for(var i in files){
-2
View File
@@ -636,8 +636,6 @@
</div>
</t>
<t t-name="message_error_uploading">Uploading error</t>
<t t-name="TreeView">
<select t-if="toolbar" style="width: 30%">
</select>