~unifield-team/unifield-web/qt-int

« back to all changes in this revision

Viewing changes to addons/openerp/controllers/attachment.py

  • Committer: jf
  • Date: 2016-08-23 12:32:56 UTC
  • mfrom: (4795.1.14 unifield-web)
  • Revision ID: jfb@tempo-consulting.fr-20160823123256-4e9kpyc8iay273iq
US-1246 [IMP] Web Performance

lp:~fabien-morin/unifield-web/perf_improvement_web @4809

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    @expose(content_type="application/octet-stream")
57
57
    def get(self, record=False):
58
58
        record = int(record)
59
 
        attachment = rpc.RPCProxy('ir.attachment').read(record, [], rpc.session.context)
 
59
        attachment = rpc.RPCProxy('ir.attachment').read(record, ['type',
 
60
        'datas', 'url', 'name'], rpc.session.context)
60
61
 
61
62
        if attachment['type'] == 'binary':
62
63
            cherrypy.response.headers["Content-Disposition"] = 'attachment; filename="%s"' % attachment['name']