Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6650)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6651)
@@ -67,7 +67,5 @@
     IStudentPayments, IStudentAccommodation, IStudentNavigation
     )
-from waeup.sirp.students.student import (
-    Student,
-    )
+from waeup.sirp.students.student import Student
 from waeup.sirp.students.catalog import search
 
@@ -228,7 +226,5 @@
     @grok.action('Create student record')
     def addStudent(self, **data):
-        student_id = self.request.form.get('form.student_id')
         student = createObject(u'waeup.Student')
-        student.student_id = student_id
         self.applyData(student, **data)
         try:
@@ -238,5 +234,5 @@
             return
         self.flash('Student record created.')
-        self.redirect(self.url(self.context[student_id], 'index'))
+        self.redirect(self.url(self.context[student.student_id], 'index'))
         return
 
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentaddpage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentaddpage.pt	(revision 6650)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentaddpage.pt	(revision 6651)
@@ -6,11 +6,4 @@
   <table>
     <tbody>
-      <tr>
-    	<td><label for="form.student_id">Student Id:</label></td>
-    	<td>
-         <input name="form.student_id" type="text" size="7" maxlength="7"
-                value="" />
-    	</td>
-      </tr>
       <tr>
     	<td><label for="form.name">Full Name:</label></td>
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 6650)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 6651)
@@ -21,14 +21,9 @@
     history = Attribute('Object history, a list of messages.')
     state = Attribute('Returns the registration state of a student')
+    student_id = Attribute('Randomly generated id')
 
     def loggerInfo(ob_class, comment):
         """Adds an INFO message to the log file
         """
-
-    student_id = schema.TextLine(
-        title = u'Student Id',
-        default = u'None',
-        required = True,
-        )
 
     name = schema.TextLine(
@@ -51,5 +46,5 @@
     """
 
-    perm_address = schema.Date(
+    perm_address = schema.Text(
         title = u'Permanent Address',
         required = False,
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6650)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6651)
@@ -25,4 +25,5 @@
 from waeup.sirp.students.interfaces import IStudent, IStudentNavigation
 from waeup.sirp.utils.helpers import attrs_to_fields
+from waeup.sirp.students.utils import generate_student_id
 
 class Student(grok.Container):
@@ -36,4 +37,5 @@
         super(Student, self).__init__()
         IWorkflowInfo(self).fireTransition('create')
+        self.student_id = generate_student_id('?')
         return
 
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py	(revision 6651)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py	(revision 6651)
@@ -0,0 +1,14 @@
+"""General helper functions for the student section.
+"""
+
+import random
+from waeup.sirp.students.catalog import search
+
+def generate_student_id(letter):
+    r = random
+    if letter == '?':
+        letter= r.choice('ABCDEFGHKLMNPQRSTUVWXY')
+    sid = "%c%d" % (letter,r.randint(99999,1000000))
+    while search(query=sid,searchtype='student_id'):
+        sid = "%c%d" % (letter,r.randint(99999,1000000))
+    return sid
