diff --git a/addons/base_module_doc_rst/base_module_doc_rst.py b/addons/base_module_doc_rst/base_module_doc_rst.py
index c7671a62bd4..9d86a191177 100755
--- a/addons/base_module_doc_rst/base_module_doc_rst.py
+++ b/addons/base_module_doc_rst/base_module_doc_rst.py
@@ -26,6 +26,7 @@ import report
from osv import fields, osv, orm
import tools
from tools.translate import _
+import addons
class module(osv.osv):
_inherit = 'ir.module.module'
@@ -104,7 +105,7 @@ class module(osv.osv):
context.update({'level': 1})
dots = self.get_graphical_representation(cr, uid, object_ids, context=context)
# todo: use os.realpath
- file_path = tools.config['addons_path']+"/base_module_doc_rst/"
+ file_path = addons.get_module_resource('base_module_doc_rst')
path_png = file_path + "/module.png"
for key, val in dots.items():
path_dotfile = file_path + "/%s.dot" % (key,)
diff --git a/addons/base_module_quality/unit_test/unit_test.py b/addons/base_module_quality/unit_test/unit_test.py
index 598d443382f..c92ba6ddeac 100644
--- a/addons/base_module_quality/unit_test/unit_test.py
+++ b/addons/base_module_quality/unit_test/unit_test.py
@@ -24,7 +24,7 @@ import os
from osv import fields, osv
from tools.translate import _
import pooler
-from tools import config
+import addons
from base_module_quality import base_module_quality
class quality_test(base_module_quality.abstract_quality_check):
@@ -45,7 +45,7 @@ This test checks the Unit Test(PyUnit) Cases of the module. Note that 'unit_test
def run_test(self, cr, uid, module_path):
pool = pooler.get_pool(cr.dbname)
module_name = module_path.split('/')[-1]
- test_file = config['addons_path'] +'/' + module_name +'/unit_test/test.py'
+ test_file = addons.get_module_resource(module_name) + '/unit_test/test.py'
if not os.path.isfile(test_file):
self.result += _("Module does not have 'unit_test/test.py' file")
return None
diff --git a/addons/hr/hr.py b/addons/hr/hr.py
index 0f499c43ddd..14949c2b37d 100644
--- a/addons/hr/hr.py
+++ b/addons/hr/hr.py
@@ -24,6 +24,7 @@ import os
from osv import fields, osv
import tools
from tools.translate import _
+import addons
import addons
@@ -182,8 +183,8 @@ class hr_employee(osv.osv):
return {'value': {'work_email' : work_email}}
def _get_photo(self, cr, uid, context=None):
- res_path = addons.get_module_resource("hr","image/photo.png")
- return open(res_path,'rb').read().encode('base64')
+ return open(addons.get_module_resource('hr','image','photo.png'),
+ 'rb').read().encode('base64')
_defaults = {
'active': 1,
diff --git a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml
index fe63a4ce7b3..2c87df69757 100644
--- a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml
+++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml
@@ -7,7 +7,7 @@
form