'When renaming admin user, we want its new name propagated to its related employees'

@api.multi
def write(self, vals):

    result = super(User, self).write(vals)
    Employee = self.env['hr.employee']
    if vals.get('name'):
        for user in self.filtered((lambda user: (user.id == SUPERUSER_ID))):
            employees = Employee.search([('user_id', '=', user.id)])
            employees.write({'name': vals['name']})
    return result
