diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-04-23 14:39:41 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-04-23 14:39:41 +0200 |
| commit | 2bc3fd89f2207c3caa7e6e51ad7004ef5325ece2 (patch) | |
| tree | 91f0b7287df8f311d08f63812a3920b9c3a3a3b9 /addons/web | |
| parent | 9f88e1f51b81229dbbf6859792430975bbdd7cd4 (diff) | |
| parent | 2d12ae3202ed93a12e1f8ff59bf64e82c0c98871 (diff) | |
[MERGE] forward port branch 10.0 up to 2d12ae3202e
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/controllers/main.py | 14 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/list_view.js | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 585cb2f36b7..ff6dac34c05 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -25,6 +25,7 @@ import werkzeug.wrappers import zlib from xml.etree import ElementTree from cStringIO import StringIO +import unicodedata import odoo @@ -1067,16 +1068,23 @@ class Binary(http.Controller): var win = window.top.window; win.jQuery(win).trigger(%s, %s); </script>""" + + filename = ufile.filename + if request.httprequest.user_agent.browser == 'safari': + # Safari sends NFD UTF-8 (where é is composed by 'e' and [accent]) + # we need to send it the same stuff, otherwise it'll fail + filename = unicodedata.normalize('NFD', ufile.filename).encode('UTF-8') + try: attachment = Model.create({ - 'name': ufile.filename, + 'name': filename, 'datas': base64.encodestring(ufile.read()), - 'datas_fname': ufile.filename, + 'datas_fname': filename, 'res_model': model, 'res_id': int(id) }) args = { - 'filename': ufile.filename, + 'filename': filename, 'mimetype': ufile.content_type, 'id': attachment.id } diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js index e9f4068ec05..d875714afd2 100644 --- a/addons/web/static/src/js/views/list_view.js +++ b/addons/web/static/src/js/views/list_view.js @@ -1089,7 +1089,7 @@ ListView.List = Class.extend({ value = record.get(column.id); // non-resolved (string) m2m values are arrays if (value instanceof Array && !_.isEmpty(value) - && !record.get(column.id + '__display')) { + && (!record.get(column.id + '__display') && record.get(column.id + '__display') !== '')) { var ids; // they come in two shapes: if (value[0] instanceof Array) { |
