From e8013fb8871ed8ba77c302699ff8a02927cc480d Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 24 Apr 2017 11:08:13 +0200 Subject: [PATCH] [FIX] raise statements In Python 3, `raise` can take: * nothing (reraises) * an exception *instance* * an exception instance `from` a traceback The Python 2 forms `raise type, instance` and `raise type, instance, traceback` are deprecated and should be replaced. Fixers: libfuturize.fixes.fix_raise #8530 --- addons/account/wizard/account_report_common.py | 2 +- odoo/service/report.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 97bd1874d25..23f6953b2dc 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -25,7 +25,7 @@ class AccountCommonReport(models.TransientModel): return result def _print_report(self, data): - raise (_('Error!'), _('Not implemented.')) + raise NotImplementedError() @api.multi def check_report(self): diff --git a/odoo/service/report.py b/odoo/service/report.py index efeef65f656..42daa393e77 100644 --- a/odoo/service/report.py +++ b/odoo/service/report.py @@ -141,6 +141,6 @@ def exp_report_get(db, uid, report_id): if self_reports[report_id]['uid'] == uid: return _check_report(report_id) else: - raise Exception, 'AccessDenied' + raise Exception('AccessDenied') else: - raise Exception, 'ReportNotFound' + raise Exception('ReportNotFound')