← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-723713-ara into lp:openobject-addons

 

Ashvin Rathod (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-723713-ara into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  #723713 [6.0] Unable to create employee with a no-admin account
  https://bugs.launchpad.net/bugs/723713

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-723713-ara/+merge/51515

Hello,

Fix the bug: Unable to create employee with a no-admin account
https://bugs.launchpad.net/openobject-addons/+bug/723713

Thanks,
ara
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-723713-ara/+merge/51515
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-723713-ara.
=== modified file 'hr/hr.py'
--- hr/hr.py	2011-01-17 18:02:22 +0000
+++ hr/hr.py	2011-02-28 11:13:06 +0000
@@ -188,10 +188,18 @@
         photo_path = addons.get_module_resource('hr','images','photo.png')
         return open(photo_path, 'rb').read().encode('base64')
 
+    def _get_address(self, cr, uid, context=None):
+        if context is None:
+            context = {}
+        address_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).address_id
+        if address_id:
+            return address_id.id
+        return False
+
     _defaults = {
         'active': 1,
         'photo': _get_photo,
-        'address_id': lambda self,cr,uid,c: self.pool.get('res.partner.address').browse(cr, uid, uid, c).partner_id.id
+        'address_id': _get_address
     }
 
     def _check_recursion(self, cr, uid, ids, context=None):


Follow ups