diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 7db8782b52e..c775927a8cc 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1201,10 +1201,13 @@ class Binary(openerpweb.Controller): """ Model = req.session.model(model) context = req.session.eval_context(req.context) + fields = [field] + if filename_field: + fields.append(filename_field) if id: - res = Model.read([int(id)], [field, filename_field], context)[0] + res = Model.read([int(id)], fields, context)[0] else: - res = Model.default_get([field, filename_field], context) + res = Model.default_get(fields, context) filecontent = base64.b64decode(res.get(field, '')) if not filecontent: return req.not_found() diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 2418439ac46..4076c190a74 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -237,7 +237,15 @@ openerp.web.auto_date_to_str = function(value, type) { }; /** - * Formats a provided cell based on its field type + * Formats a provided cell based on its field type. Most of the field types + * return a correctly formatted value, but some tags and fields are + * special-cased in their handling: + * + * * buttons will return an actual ``