From 8351c6c5edfa8327eda3169548f67c1b9c72a1b8 Mon Sep 17 00:00:00 2001 From: moylop260 Date: Mon, 27 Oct 2014 17:45:03 -0600 Subject: [PATCH] [IMP] Use explicitly relative imports in backend doc closes #3336 Implicit relative imports have been removed in Python 3, and developers should be encouraged to use explicitly relative imports to avoid confusion between local and global modules See https://www.python.org/dev/peps/pep-0328 for PEP on the subject with reasonings and justifications --- doc/howtos/backend.rst | 2 +- doc/howtos/backend/exercise-creation | 4 ++-- doc/howtos/backend/exercise-model-inheritance | 6 +++--- doc/howtos/backend/exercise-wizard | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index fcbc10e3721..55e49a4b4c3 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -108,7 +108,7 @@ files in the module. For instance, if the module has a single ``mymodule.py`` file ``__init__.py`` might contain:: - import mymodule + from . import mymodule Fortunately, there is a mechanism to help you set up an module. The command ``odoo.py`` has a subcommand :ref:`scaffold ` to diff --git a/doc/howtos/backend/exercise-creation b/doc/howtos/backend/exercise-creation index 4b780bddbb7..353556a43b5 100644 --- a/doc/howtos/backend/exercise-creation +++ b/doc/howtos/backend/exercise-creation @@ -46,8 +46,8 @@ Index: addons/openacademy/__init__.py +++ addons/openacademy/__init__.py 2014-08-26 17:25:49.791783523 +0200 @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- -+import controllers -+import models ++from . import controllers ++from . import models Index: addons/openacademy/controllers.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/doc/howtos/backend/exercise-model-inheritance b/doc/howtos/backend/exercise-model-inheritance index ddc84ea6886..a3529403d55 100644 --- a/doc/howtos/backend/exercise-model-inheritance +++ b/doc/howtos/backend/exercise-model-inheritance @@ -7,9 +7,9 @@ Index: addons/openacademy/__init__.py +++ addons/openacademy/__init__.py 2014-08-26 17:26:01.219783354 +0200 @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- - import controllers - import models -+import partner + from . import controllers + from . import models ++from . import partner Index: addons/openacademy/__openerp__.py =================================================================== --- addons.orig/openacademy/__openerp__.py 2014-08-26 17:26:01.227783353 +0200 diff --git a/doc/howtos/backend/exercise-wizard b/doc/howtos/backend/exercise-wizard index 1605185bf05..906cdef181b 100644 --- a/doc/howtos/backend/exercise-wizard +++ b/doc/howtos/backend/exercise-wizard @@ -3,10 +3,10 @@ Index: addons/openacademy/__init__.py --- addons.orig/openacademy/__init__.py 2014-08-27 14:19:23.023111330 +0200 +++ addons/openacademy/__init__.py 2014-08-27 14:22:25.043108628 +0200 @@ -2,3 +2,4 @@ - import controllers - import models - import partner -+import wizard + from . import controllers + from . import models + from . import partner ++from . import wizard Index: addons/openacademy/wizard.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000