Merge lp:~julie-w/unifield-web/UTP-1060 into lp:unifield-web

Proposed by jftempo
Status: Merged
Merged at revision: 4780
Proposed branch: lp:~julie-w/unifield-web/UTP-1060
Merge into: lp:unifield-web
Diff against target: 24 lines (+7/-1)
1 file modified
addons/openerp/controllers/actions.py (+7/-1)
To merge this branch: bzr merge lp:~julie-w/unifield-web/UTP-1060
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+287284@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/actions.py'
2--- addons/openerp/controllers/actions.py 2016-01-21 17:24:12 +0000
3+++ addons/openerp/controllers/actions.py 2016-02-26 10:05:26 +0000
4@@ -35,6 +35,7 @@
5 from tree import Tree
6 from wizard import Wizard
7 import urllib
8+import unicodedata
9 import re
10 import os
11
12@@ -225,7 +226,12 @@
13 cherrypy.response.headers['Content-Type'] = 'application/octet-stream'
14 report_type = val['format']
15
16- cherrypy.response.headers['Content-Disposition'] = '%sfilename="' % attachment + report_name.decode('utf-8') + '.' + report_type + '"'
17+ try:
18+ report_name = report_name.decode('utf-8')
19+ except UnicodeEncodeError:
20+ # replace all compatibility characters with their equivalents ("e with accent" becomes "e"...)
21+ report_name = unicodedata.normalize('NFKD', report_name).encode('ascii','ignore')
22+ cherrypy.response.headers['Content-Disposition'] = '%sfilename="' % attachment + report_name + '.' + report_type + '"'
23
24 return _print_data(val)
25

Subscribers

People subscribed via source and target branches