From 900701213f1700ed56e2a82a098a35171b253bec Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 25 Apr 2017 18:45:28 +0200 Subject: [PATCH] [IMP] test_pylint: check for python3 incompatibilities Cherry-pick of 9882f24313c988b1f8e40f1fbe734a798b0dbf7b --- odoo/addons/base/module/module.py | 1 + odoo/addons/base/module/wizard/base_module_upgrade.py | 1 + odoo/addons/base/res/res_config.py | 7 ++++++- odoo/addons/test_pylint/tests/test_pylint.py | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py index cc77b392a18..91449a25343 100644 --- a/odoo/addons/base/module/module.py +++ b/odoo/addons/base/module/module.py @@ -507,6 +507,7 @@ class Module(models.Model): self._cr.commit() env = api.Environment(self._cr, self._uid, self._context) + # pylint: disable=next-method-called config = env['ir.module.module'].next() or {} if config.get('type') not in ('ir.actions.act_window_close',): return config diff --git a/odoo/addons/base/module/wizard/base_module_upgrade.py b/odoo/addons/base/module/wizard/base_module_upgrade.py index 2544675df3d..a590111e644 100644 --- a/odoo/addons/base/module/wizard/base_module_upgrade.py +++ b/odoo/addons/base/module/wizard/base_module_upgrade.py @@ -79,4 +79,5 @@ class BaseModuleUpgrade(models.TransientModel): @api.multi def config(self): + # pylint: disable=next-method-called return self.env['res.config'].next() diff --git a/odoo/addons/base/res/res_config.py b/odoo/addons/base/res/res_config.py index 4176d57ae52..7fd426ed2c5 100644 --- a/odoo/addons/base/res/res_config.py +++ b/odoo/addons/base/res/res_config.py @@ -53,9 +53,9 @@ class ResConfigConfigurable(models.TransientModel): ''' _name = 'res.config' - @api.multi def start(self): + # pylint: disable=next-method-called return self.next() @api.multi @@ -105,6 +105,7 @@ class ResConfigConfigurable(models.TransientModel): an action dictionary -- executes the action provided by calling ``next``. """ + # pylint: disable=next-method-called return self.execute() or self.next() @api.multi @@ -116,6 +117,7 @@ class ResConfigConfigurable(models.TransientModel): an action dictionary -- executes the action provided by calling ``next``. """ + # pylint: disable=next-method-called return self.cancel() or self.next() @api.multi @@ -130,6 +132,7 @@ class ResConfigConfigurable(models.TransientModel): an action dictionary -- executes the action provided by calling ``next``. """ + # pylint: disable=next-method-called return self.cancel() or self.next() @@ -561,6 +564,8 @@ class ResConfigSettings(models.TransientModel, ResConfigModuleInstallationMixin) # are no longer valid. So we reset the environment. self.env.reset() self = self.env()[self._name] + + # pylint: disable=next-method-called config = self.env['res.config'].next() or {} if config.get('type') not in ('ir.actions.act_window_close',): return config diff --git a/odoo/addons/test_pylint/tests/test_pylint.py b/odoo/addons/test_pylint/tests/test_pylint.py index d1a40dc43c2..d5df3d60ecb 100644 --- a/odoo/addons/test_pylint/tests/test_pylint.py +++ b/odoo/addons/test_pylint/tests/test_pylint.py @@ -25,6 +25,11 @@ class TestPyLint(TransactionCase): 'W0123', # eval used 'W0101', # unreachable code + # py3k checks + 'print-statement', + 'backtick', + 'next-method-called', + 'misplaced-future', 'relative-import', 'deprecated-module',