Merge pull request #590 from xmo-odoo/master-public-binary-xmo
Make attachment data available under public by default
This commit is contained in:
commit
02677579d2
|
@ -1114,7 +1114,7 @@ class TreeView(View):
|
||||||
|
|
||||||
class Binary(http.Controller):
|
class Binary(http.Controller):
|
||||||
|
|
||||||
@http.route('/web/binary/image', type='http', auth="user")
|
@http.route('/web/binary/image', type='http', auth="public")
|
||||||
def image(self, model, id, field, **kw):
|
def image(self, model, id, field, **kw):
|
||||||
last_update = '__last_update'
|
last_update = '__last_update'
|
||||||
Model = request.session.model(model)
|
Model = request.session.model(model)
|
||||||
|
@ -1169,7 +1169,7 @@ class Binary(http.Controller):
|
||||||
addons_path = http.addons_manifest['web']['addons_path']
|
addons_path = http.addons_manifest['web']['addons_path']
|
||||||
return open(os.path.join(addons_path, 'web', 'static', 'src', 'img', image), 'rb').read()
|
return open(os.path.join(addons_path, 'web', 'static', 'src', 'img', image), 'rb').read()
|
||||||
|
|
||||||
@http.route('/web/binary/saveas', type='http', auth="user")
|
@http.route('/web/binary/saveas', type='http', auth="public")
|
||||||
@serialize_exception
|
@serialize_exception
|
||||||
def saveas(self, model, field, id=None, filename_field=None, **kw):
|
def saveas(self, model, field, id=None, filename_field=None, **kw):
|
||||||
""" Download link for files stored as binary fields.
|
""" Download link for files stored as binary fields.
|
||||||
|
@ -1203,7 +1203,7 @@ class Binary(http.Controller):
|
||||||
[('Content-Type', 'application/octet-stream'),
|
[('Content-Type', 'application/octet-stream'),
|
||||||
('Content-Disposition', content_disposition(filename))])
|
('Content-Disposition', content_disposition(filename))])
|
||||||
|
|
||||||
@http.route('/web/binary/saveas_ajax', type='http', auth="user")
|
@http.route('/web/binary/saveas_ajax', type='http', auth="public")
|
||||||
@serialize_exception
|
@serialize_exception
|
||||||
def saveas_ajax(self, data, token):
|
def saveas_ajax(self, data, token):
|
||||||
jdata = simplejson.loads(data)
|
jdata = simplejson.loads(data)
|
||||||
|
|
Loading…
Reference in New Issue