diff options
| author | Adrian Torres <adt@odoo.com> | 2018-11-08 15:27:30 +0000 |
|---|---|---|
| committer | Adrian Torres <adt@odoo.com> | 2018-11-29 09:28:17 +0000 |
| commit | 52f5528cfb6d1152ee226e268247dc685a8ba329 (patch) | |
| tree | b44ecfa477b50dd3e488f09f623eecc8bc8e9d7d /odoo/tools/test_reports.py | |
| parent | e5c864a596b72515837f0ed1e07550398ecc1ab0 (diff) | |
[REF] *: replace deprecated pycompat helpers for builtins
This commit replaces calls to pycompat helpers that were intended for
python 2 <-> python 3 interoperability for python 3 builtins, as python
2 is no longer officially supported by Odoo.
This includes:
* calls to imap/izip/ifilter replaced by map/zip/filter
* uses of text_type replaced by str
* uses of unichr replaced by chr
* calls to implements_to_string, implements_iterator removed
* string_types and integer_types replaced by str, int respectively
* calls to to_native replaced by calls to to_text
This is done in preparation to the removal of these deprecated helpers
in the following commit.
Diffstat (limited to 'odoo/tools/test_reports.py')
| -rw-r--r-- | odoo/tools/test_reports.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/odoo/tools/test_reports.py b/odoo/tools/test_reports.py index 803d9fc18c5..ef3e61ecb42 100644 --- a/odoo/tools/test_reports.py +++ b/odoo/tools/test_reports.py @@ -13,7 +13,7 @@ import tempfile from subprocess import Popen, PIPE from .. import api -from . import pycompat, ustr, config +from . import ustr, config from .safe_eval import safe_eval _logger = logging.getLogger(__name__) @@ -88,7 +88,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None, Eg. 'OK' or 'fa-print' :param our_module: the name of the calling module (string), like 'account' """ - if not our_module and isinstance(action_id, pycompat.string_types): + if not our_module and isinstance(action_id, str): if '.' in action_id: our_module = action_id.split('.', 1)[0] @@ -109,7 +109,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None, if not wiz_buttons: wiz_buttons = [] - if isinstance(action_id, pycompat.string_types): + if isinstance(action_id, str): if '.' in action_id: _, act_xmlid = action_id.split('.', 1) else: @@ -120,7 +120,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None, action = env.ref(action_id) act_model, act_id = action._name, action.id else: - assert isinstance(action_id, pycompat.integer_types) + assert isinstance(action_id, int) act_model = 'ir.action.act_window' # assume that act_id = action_id act_xmlid = '<%s>' % act_id @@ -134,7 +134,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None, if datas.get('id',False): context.update( {'active_id': datas.get('id',False), 'active_ids': datas.get('ids',[]), 'active_model': datas.get('model',False)}) context1 = action.get('context', {}) - if isinstance(context1, pycompat.string_types): + if isinstance(context1, str): context1 = safe_eval(context1, dict(context)) context.update(context1) env = env(context=context) |
