Wrong import of module base

Bug #1187300 reported by Guewen Baconnier @ Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Geospatial Addons for OpenERP
Confirmed
Undecided
Unassigned

Bug Description

The 'base' module is imported with 'import base'.

It impacts OpenERP 6.1 and 7.0.

In some conditions, it can lead to errors like the following:

<snip>
line 25, in <module>
    from openerp.addons.base_geoengine import geo_model
  File "/<snip>/src/server/openerp/modules/module.py",
line 139, in load_module
    mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
  File "/<snip>/src/geoengine/base_geoengine/__init__.py",
line 28, in <module>
    from . import geo_ir
  File "/<snip>/src/geoengine/base_geoengine/geo_ir/__init__.py",
line 22, in <module>
    from . import ir_model
  File "/<snip>/src/geoengine/base_geoengine/geo_ir/ir_model.py",
line 23, in <module>
    if 'geoengine' not in base.ir.ir_actions.VIEW_TYPES:
AttributeError: 'module' object has no attribute 'ir'

Replacing the import in `base_geoengine/geo_ir/ir_model.py` by:

`from openerp.addons import base`

It works correctly.

Note that all the others "shortcut" imports could potentially lead to the same error and should be replaced by the complete namespace starting from the `openerp` package.

Changed in geospatial-addons:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.