Comment 0 for bug 666714

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Starting with v6.0 OpenERP supports multiple addons paths. This means that one cannot simply access tools.config['addons_path'] and use it with os.path.join to access a resource file from a module.
OpenERP also support zipped modules, which means that merely doing an os.path.join() will not work to open the file.

Please instead use addons.get_module_resource( ) to obtain the path to the resource.
Also make sure to verify the return value of get_module_resource( ), which could be False when the file was not found.

For the framework, we also need to fix tools.file_open to properly handle this.