← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 655792] Re: bug in hr/hr.py

 

it has been fixed in trunk. thanks for the contribution

** Changed in: openobject-addons
       Status: New => Fix Released

-- 
bug in hr/hr.py
https://bugs.launchpad.net/bugs/655792
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: Fix Released

Bug description:
If there is more than one addons path defined (in config file), then the routine get_photo crashes because it assumes there is only one addon path defined.

Here is the fix:

 def _get_photo(self, cr, uid, context=None):        
        if tools.config['addons_path'].find(',') != -1:
            addons_path = tools.config['addons_path'].split(',')
            for path in addons_path:                
                if os.path.isfile(os.path.join(path, 'hr/image', 'photo.png')):
                    return open(os.path.join(path, 'hr/image', 'photo.png'),'rb').read().encode('base64')
        else:
            return open(os.path.join( tools.config['addons_path'], 'hr/image', 'photo.png'),'rb').read().encode('base64')