From a84cbe690b01af26ed8480b699416c6b36e5959b Mon Sep 17 00:00:00 2001 From: Pieter Paulussen Date: Fri, 6 Jan 2017 14:14:41 +0100 Subject: [PATCH] FIX import error for odoo v10 Mixup in odoo import --- anybox/recipe/odoo/runtime/session.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/anybox/recipe/odoo/runtime/session.py b/anybox/recipe/odoo/runtime/session.py index 2b6db4cd..7a8cc94c 100644 --- a/anybox/recipe/odoo/runtime/session.py +++ b/anybox/recipe/odoo/runtime/session.py @@ -7,29 +7,20 @@ try: - import openerp as odoo + import odoo except ImportError: try: - import odoo + import openerp as odoo except ImportError: warnings.warn("This must be imported with a buildout odoo recipe " "driven sys.path", RuntimeWarning) - else: - try: - from odoo.cli import server as startup - except ImportError: - from .backports.cli import server as startup - from odoo.tools import config - from odoo import SUPERUSER_ID - from odoo.tools.parse_version import parse_version -else: - try: - from openerp.cli import server as startup - except ImportError: - from .backports.cli import server as startup - from openerp.tools import config - from openerp import SUPERUSER_ID - from openerp.tools.parse_version import parse_version +try: + from odoo.cli import server as startup +except ImportError: + from .backports.cli import server as startup +from odoo.tools import config +from odoo import SUPERUSER_ID +from odoo.tools.parse_version import parse_version from optparse import OptionParser # we support python >= 2.6