c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #01211
[Bug 666714] Re: [6.0rc1] some addons directly access tools.config['addons_path']
** Changed in: openobject-addons
Assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) => OpenERP R&D Addons Team 1 (openerp-dev-addons1)
--
[6.0rc1] some addons directly access tools.config['addons_path']
https://bugs.launchpad.net/bugs/666714
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Addons Modules: In Progress
Status in OpenObject Server: Invalid
Bug description:
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 (which could be inside a zip file!)
Also make sure to verify the return value of get_module_resource( ), which could be False when the file was not found.
You could also use directly tools.misc.file_open() which will return the open file even if it is inside a zip (also needs its own error checking)
References