In order to hide Employee addresses from Customer and Supplier list, you can Uncheck 'Customer' and 'Supplier' from Partner form.
I solved with following code
class hr_employee(osv.osv):
_inherit = "hr.employee"
def create(self, cr, uid, data, context=None):
if 'address_id' in data and data['address_id']:
partner_ids = [data['address_id']]
if 'address_home_id' in data and data['address_home_id']:
partner_ids.append(data['address_home_id'])
self.pool.get('res.partner').write(cr, uid, partner_ids, {'customer': False, 'supplier':False}, context=context)
return super(hr_employee, self).create(cr, uid, data, context=context)
def write(self, cr, uid, ids, data, context=None):
if 'address_id' in data and data['address_id']:
partner_ids = [data['address_id']]
if 'address_home_id' in data and data['address_home_id']:
partner_ids.append(data['address_home_id'])
self.pool.get('res.partner').write(cr, uid, partner_ids, {'customer': False, 'supplier':False}, context=context)
return super(hr_employee, self).write(cr, uid, ids, data, context=context)
So that whenever you create new employee, that addresses of employee does treat as neither customer nor supplier. You have to manually correct for existing employee addresses.
I would suggest you should create custom module and in that module inherit employee object and view.
Thanks Sudhir. Unfortunately I'm not advanced enough to be creating custom modules yet. I thought there might be an easy way (no coding that is) to change where that field pulls its data from.