Index: /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py	(revision 12355)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py	(revision 12356)
@@ -863,5 +863,5 @@
     grok.context(ICustomerDocumentsContainer)
     grok.name('adddoc')
-    grok.template('documentaddform')
+    grok.template('documentaddpage')
     grok.require('waeup.editCustomerDocuments')
     label = _('Add document')
@@ -874,4 +874,18 @@
         doctypes = getUtility(ICustomersUtils).SELECTABLE_DOCTYPES_DICT
         return sorted(doctypes.items())
+
+    @property
+    def edit_documents_allowed(self):
+        right_customer_state = self.context.customer.state in getUtility(
+            ICustomersUtils).DOCMANAGE_CUSTOMER_STATES
+        if isCustomer(self.request.principal) and not right_customer_state:
+            return False
+        return True
+
+    def update(self):
+        if not self.edit_documents_allowed:
+            emit_lock_message(self)
+            return
+        return super(DocumentAddFormPage, self).update()
 
     @action(_('Add document'), style='primary')
@@ -889,5 +903,10 @@
         self.context.writeLogMessage(
             self,'added: %s %s' % (doctype, document.document_id))
-        self.redirect(self.url(self.context))
+        isCustomer = getattr(
+            self.request.principal, 'user_type', None) == 'customer'
+        if isCustomer:
+            self.redirect(self.url(document, 'edit') + '#tab2')
+        else:
+            self.redirect(self.url(document, 'manage') + '#tab2')
         return
 
@@ -1207,5 +1226,5 @@
 
 
-class ContractAddPage(IkobaAddFormPage):
+class ContractAddFormPage(IkobaAddFormPage):
     """ Page to add an contract
 
@@ -1234,5 +1253,5 @@
             emit_lock_message(self)
             return
-        return super(ContractAddPage, self).update()
+        return super(ContractAddFormPage, self).update()
 
     @property
Index: in/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentaddform.pt
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentaddform.pt	(revision 12355)
+++ 	(revision )
@@ -1,27 +1,0 @@
-<form action="." tal:attributes="action request/URL" method="post"
-      enctype="multipart/form-data" i18n:domain="waeup.ikoba">
-  <table class="form-table">
-    <tbody>
-      <tr>
-        <td class="fieldname">
-          <span i18n:translate="">Document Type</span>:
-        </td>
-        <td>
-          <select id="doctype" name="doctype" size="1"
-                  class="form-control half">
-            <option tal:repeat="item view/selectable_doctypes"
-                    tal:attributes="value python:item[0]">
-              <span tal:replace="python:item[1]">DOCTYPE</span>
-            </option>
-          </select>
-        </td>
-      </tr>
-    </tbody>
-    <tal:widgets content="structure provider:widgets" />
-  </table>
-  <div tal:condition="view/availableActions">
-    <input tal:repeat="action view/actions"
-           tal:replace="structure action/render"
-           />
-  </div>
-</form>
Index: /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentaddpage.pt
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentaddpage.pt	(revision 12356)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentaddpage.pt	(revision 12356)
@@ -0,0 +1,27 @@
+<form action="." tal:attributes="action request/URL" method="post"
+      enctype="multipart/form-data" i18n:domain="waeup.ikoba">
+  <table class="form-table">
+    <tbody>
+      <tr>
+        <td class="fieldname">
+          <span i18n:translate="">Document Type</span>:
+        </td>
+        <td>
+          <select id="doctype" name="doctype" size="1"
+                  class="form-control half">
+            <option tal:repeat="item view/selectable_doctypes"
+                    tal:attributes="value python:item[0]">
+              <span tal:replace="python:item[1]">DOCTYPE</span>
+            </option>
+          </select>
+        </td>
+      </tr>
+    </tbody>
+    <tal:widgets content="structure provider:widgets" />
+  </table>
+  <div tal:condition="view/availableActions">
+    <input tal:repeat="action view/actions"
+           tal:replace="structure action/render"
+           />
+  </div>
+</form>
Index: /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py	(revision 12355)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py	(revision 12356)
@@ -65,6 +65,4 @@
     """This is a customer document baseclass.
     """
-    grok.implements(ICustomerDocument, ICustomerNavigation)
-    grok.provides(ICustomerDocument)
     grok.baseclass()
 
@@ -189,4 +187,7 @@
     """This is a sample customer document.
     """
+
+    grok.implements(ICustomerDocument, ICustomerNavigation)
+    grok.provides(ICustomerDocument)
 
     # Ikoba can store any number of files per Document object.
Index: /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12355)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12356)
@@ -931,4 +931,8 @@
         self.browser.getLink("Documents").click()
         self.browser.getControl("Add document").click()
+        self.assertTrue('The requested form is locked' in self.browser.contents)
+        # Customer is in wrong state
+        IWorkflowState(self.customer).setState(APPROVED)
+        self.browser.getControl("Add document").click()
         self.browser.getControl(name="doctype").value = ['CustomerSampleDocument']
         self.browser.getControl(name="form.title").value = 'My Sample Document'
@@ -937,13 +941,4 @@
         docid = [i for i in self.customer['documents'].keys() if len(i) > 10][0]
         document = self.customer['documents'][docid]
-
-        # Document can be edited ...
-        self.browser.getLink(docid[:6]).click()
-        self.browser.open(self.documents_path + '/' + docid + '/edit')
-        #self.browser.getLink("Edit").click()
-        self.assertTrue('The requested form is locked' in self.browser.contents)
-        # Customer is in wrong state
-        IWorkflowState(self.customer).setState(APPROVED)
-        self.browser.open(self.documents_path + '/' + docid + '/edit')
         self.browser.getControl(name="form.title").value = 'My second doc'
         self.browser.getControl("Save").click()
@@ -953,5 +948,5 @@
         self.assertEqual(
             self.browser.url, self.documents_path + '/%s/index' % docid)
-        # Costumer can upload a document.
+        # Customer can upload a document.
         self.browser.getLink("Edit").click()
         ctrl = self.browser.getControl(name='samplescaneditupload')
@@ -964,5 +959,5 @@
             'href="http://localhost/app/customers/K1000000/documents/%s/sample"'
             % docid in self.browser.contents)
-        # Costumer can submit the form. The form is also saved.
+        # Customer can submit the form. The form is also saved.
         self.browser.getControl(name="form.title").value = 'My third doc'
         self.browser.getControl("Final Submit").click()
@@ -1217,5 +1212,5 @@
             in logcontent)
         self.assertTrue(
-            'INFO - zope.mgr - customers.browser.ContractAddPage '
+            'INFO - zope.mgr - customers.browser.ContractAddFormPage '
             '- K1000000 - added: Sample Contract %s'
             % contract.contract_id in logcontent)
