diff --git a/addons/hr/hr.py b/addons/hr/hr.py index bdaca6e2ace..841370a97f2 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -18,7 +18,10 @@ # along with this program. If not, see . # ############################################################################## +import os + from osv import fields, osv +import tools from tools.translate import _ class hr_employee_category(osv.osv): @@ -109,11 +112,19 @@ class hr_employee(osv.osv): 'category_id' : fields.many2one('hr.employee.category', 'Category'), 'child_ids': fields.one2many('hr.employee', 'parent_id','Subordinates'), 'resource_id': fields.many2one('resource.resource','Resource',ondelete='cascade'), - 'coach_id':fields.many2one('res.users','Coach'), - 'job_id':fields.many2one('hr.job', 'Job'), + 'coach_id': fields.many2one('res.users','Coach'), + 'job_id': fields.many2one('hr.job', 'Job'), + 'photo': fields.binary('Photo') } + + 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') + _defaults = { - 'active' : lambda *a: True, + 'active' : 1, + 'photo': _get_photo, } def _check_recursion(self, cr, uid, ids): diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 6fe3b913aa0..6f20b9fda14 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -21,13 +21,20 @@ form
- - - - - + + + + + + + + + + + + - + @@ -51,9 +58,9 @@ - + diff --git a/addons/hr/image/photo.png b/addons/hr/image/photo.png new file mode 100644 index 00000000000..1edfe4754fc Binary files /dev/null and b/addons/hr/image/photo.png differ