diff options
| author | Xavier Morel <xmo@odoo.com> | 2017-05-02 12:07:30 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2017-08-20 23:25:54 +0200 |
| commit | 7dd062f83552fa8ff96224c29d60bafc001d73d3 (patch) | |
| tree | d507e27e9d5daa91981e04b5aa81a802a9854a8d /addons/web/controllers | |
| parent | 3824b5dcc13678d3985ad45ac21dcf9ac9202c20 (diff) | |
[FIX] P3: text model types
* remove references to basestring & unicode (use relevant pycompat
helpers)
* remove some str calls (either entirely or replaced by relevant
helper, either text or native)
* use better API to avoid unnecessary conversions
* remove some XML declarations in views
Diffstat (limited to 'addons/web/controllers')
| -rw-r--r-- | addons/web/controllers/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 4efc3df9eec..9ac7b7a2fd8 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1396,7 +1396,7 @@ class CSVExport(ExportFormat, http.Controller): for data in rows: row = [] for d in data: - if isinstance(d, unicode): + if type(d) != str and isinstance(d, pycompat.string_types): try: d = d.encode('utf-8') except UnicodeError: @@ -1446,7 +1446,7 @@ class ExcelExport(ExportFormat, http.Controller): for row_index, row in enumerate(rows): for cell_index, cell_value in enumerate(row): cell_style = base_style - if isinstance(cell_value, basestring): + if isinstance(cell_value, pycompat.string_types): cell_value = re.sub("\r", " ", cell_value) elif isinstance(cell_value, datetime.datetime): cell_style = datetime_style |
