Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py	(revision 12195)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py	(revision 12196)
@@ -1346,5 +1346,5 @@
     """Deliver pdf file including metadata.
     """
-    grok.context(IContract)
+    grok.context(ISampleContract)
     grok.name('contract_slip.pdf')
     grok.require('waeup.viewCustomer')
@@ -1354,7 +1354,6 @@
                    'suspended_comment',)
 
-    #form_fields = grok.AutoFields(ICustomerPDFContract).omit(
-    #    'last_transition_date')
-    form_fields =()
+    form_fields = grok.AutoFields(ISampleContract).omit(
+        'last_transition_date')
 
     @property
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py	(revision 12195)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py	(revision 12196)
@@ -78,5 +78,5 @@
             self.contract_id = generate_contract_id()
         except AttributeError:
-            self.contract_id = u'a123'
+            self.contract_id = u'c999'
         self.last_product_id = None
         return
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 12195)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12196)
@@ -156,5 +156,4 @@
 
 
-
 class CustomersContainerUITests(CustomersFullSetup):
     # Tests for CustomersContainer class views and pages
@@ -1110,4 +1109,18 @@
         open(path, 'wb').write(self.browser.contents)
         print "Sample pdfdocument_slip.pdf written to %s" % path
+
+    def test_get_setmd5_file(self):
+        # A proper file name chooser is registered for customer documents.
+        # This is not a UI test. It's just a functional test.
+        file_id = IFileStoreNameChooser(self.document).chooseName(attr='sample')
+        fs = ExtFileStore(root=self.dc_root)
+        fs.createFile(file_id, StringIO('my sample 1'))
+        result = fs.getFileByContext(self.document, attr='sample')
+        self.assertEqual(file_id, '__file-customerdocument__01000/K1000000/sample_d101_K1000000')
+        self.assertEqual(result.read(), 'my sample 1')
+        self.assertEqual(self.document.connected_files[0][1].read(), 'my sample 1')
+        self.document.setMD5()
+        self.assertEqual(self.document.sample_md5, 'a406995ee8eb6772bacf51aa4b0caa24')
+        return
 
 
@@ -1259,5 +1272,9 @@
         open(path, 'wb').write(self.browser.contents)
         print "Sample PDF overview_slip.pdf written to %s" % path
-        # Officers can open contract slips
+        # Officers can open contract slips.
+        # First we add a submitted document and a product.
+        IWorkflowState(self.document).setState(SUBMITTED)
+        self.contract.document_object = self.document
+        self.contract.product_object = self.product
         self.browser.open(self.customer_path + '/contracts/c101')
         self.browser.getLink("Download contract slip").click()
@@ -1301,17 +1318,2 @@
         self.browser.getControl("Save").click()
         self.assertEqual(IWorkflowState(self.contract).getState(), 'approved')
-
-    def test_get_setmd5_file(self):
-        # A proper file name chooser is registered for customer documents.
-        # This is not a UI test. It just a functional test.
-        file_id = IFileStoreNameChooser(self.document).chooseName(attr='sample')
-        fs = ExtFileStore(root=self.dc_root)
-        fs.createFile(file_id, StringIO('my sample 1'))
-        result = fs.getFileByContext(self.document, attr='sample')
-        self.assertEqual(file_id, '__file-customerdocument__01000/K1000000/sample_d101_K1000000')
-        self.assertEqual(result.read(), 'my sample 1')
-        self.assertEqual(self.document.connected_files[0][1].read(), 'my sample 1')
-        self.document.setMD5()
-        self.assertEqual(self.document.sample_md5, 'a406995ee8eb6772bacf51aa4b0caa24')
-        return
-
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_contract.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_contract.py	(revision 12195)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_contract.py	(revision 12196)
@@ -62,5 +62,5 @@
         self.assertRaises(TypeError, container.addContract, object())
         self.assertEqual(contract.class_name, 'SampleContract')
-        self.assertEqual(id, 'a123')
+        self.assertEqual(id, 'c999')
         return
 
