[6.0rc1] some addons directly access tools.config['addons_path']

Bug #666714 reported by Olivier Dony (Odoo)
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 1
Odoo Server (MOVED TO GITHUB)
Invalid
Medium
Unassigned

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)

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Changed in openobject-server:
importance: Undecided → Medium
milestone: none → 6.0-rc2
status: New → Confirmed
status: Confirmed → Invalid
description: updated
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Marked openobject-server affectation as invalid because tools.misc.file_open already supports multiple addons paths as introduced in v6, sorry about the spam.

Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

Hello,

It is committed into lp:~openerp-dev/openobject-addons/trunk-dev-addons1 at Revision 3597.

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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