summaryrefslogtreecommitdiff
path: root/odoo/tools/test_reports.py
diff options
context:
space:
mode:
authorxmo-odoo <xmo@odoo.com>2017-04-27 13:59:33 +0200
committerGitHub <noreply@github.com>2017-04-27 13:59:33 +0200
commit2e6a589f417af48e3322955ffff6e94b6d8a24e3 (patch)
treeaa613ecc1f74a9531a03de89aa2bdc7bb32eed3b /odoo/tools/test_reports.py
parentde4a2216b953abb86094c9bfa5f45b1eaaa79d3d (diff)
[FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch * thin compat module stripped down from werkzeug (to augment as needed) issue 8530
Diffstat (limited to 'odoo/tools/test_reports.py')
-rw-r--r--odoo/tools/test_reports.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/odoo/tools/test_reports.py b/odoo/tools/test_reports.py
index ef09862bc01..c1f9af8bb55 100644
--- a/odoo/tools/test_reports.py
+++ b/odoo/tools/test_reports.py
@@ -11,6 +11,8 @@ import odoo
import odoo.report
import odoo.tools as tools
import logging
+
+from odoo.tools import pycompat
from odoo.tools.safe_eval import safe_eval
from subprocess import Popen, PIPE
import os
@@ -45,7 +47,7 @@ def try_report(cr, uid, rname, ids, data=None, context=None, our_module=None, re
raise ValueError("Report %s produced an empty result!" % rname)
if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], rname+ '.'+res_format), 'wb+').write(res_data)
+ open(os.path.join(tools.config['test_report_directory'], rname+ '.'+res_format), 'wb+').write(res_data)
_logger.debug("Have a %s report for %s, will examine it", res_format, rname)
if res_format == 'pdf':
@@ -128,7 +130,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, (long, int))
+ assert isinstance(action_id, pycompat.integer_types)
act_model = 'ir.action.act_window' # assume that
act_id = action_id
act_xmlid = '<%s>' % act_id