From a5f271f50de72282bbaaac624d14295eef7d51f4 Mon Sep 17 00:00:00 2001 From: nvi-openerp Date: Tue, 19 Oct 2010 16:48:45 +0200 Subject: [PATCH] [FIX] Fixed problem with hr when we use a addons_path with multiple paths bzr revid: nicolas.vanhoren@openerp.com-20101019144845-xaln01cug0hw8ykv --- addons/hr/hr.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 240511a03a0..d3cb41fc89d 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -184,9 +184,12 @@ class hr_employee(osv.osv): return {'value': {'work_email':mail.user_email}} def _get_photo(self, cr, uid, context=None): - return open(os.path.join( - tools.config['addons_path'], 'hr/image', 'photo.png'), - 'rb') .read().encode('base64') + paths = tools.config['addons_path'].split(",") + for path in paths: + full_path = os.path.join(path, 'hr/image', 'photo.png') + if os.path.exists(full_path): + return open(full_path,'rb') .read().encode('base64') + raise Exception("photo.png could not be found") _defaults = { 'active': 1,