Index: /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py	(revision 14201)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py	(revision 14202)
@@ -154,4 +154,5 @@
         contract = createObject('waeup.SampleContract')
         contract.contract_id = u'CON1'
+        customer['contracts'].addContract(contract)
         contract.product_object = self.product
         contract.document_object = self.document
@@ -160,6 +161,4 @@
         contract.valid_from = datetime.date(2014, 2, 4)
         contract.valid_to = datetime.date(2014, 12, 4)
-
-        customer['contracts'].addContract(contract)
         self.contract = contract
         return customer
@@ -535,6 +534,5 @@
     def test_import_update(self):
         # We perform the same import twice,
-        # the second time in update mode. The number
-        # of warnings must be the same.
+        # the second time in update mode. No record can be imported.
         num, num_warns, fin_file, fail_file = self.processor.doImport(
             self.csv_file, CONTRACT_HEADER_FIELDS,'create')
@@ -544,5 +542,7 @@
         # There are one record without contract_id and two
         # records with wrong object identifier.
-        self.assertEqual(num_warns,3)
+        # The other 4 records cannot be imported because DOC1 does
+        # not belong to these customers.
+        self.assertEqual(num_warns,7)
         shutil.rmtree(os.path.dirname(fin_file))
 
Index: /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py	(revision 14201)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py	(revision 14202)
@@ -182,7 +182,13 @@
 
     def getValues(self, context):
-        # When checking conversion during import, contracts do not belong to
-        # customers. Thus all portal documents must be returned.
-        user_id = getattr(getattr(context, 'customer', None), 'user_id', None)
+        # When checking conversion during import in create mode,
+        # contracts do not belong to customers.
+        # Thus all portal documents must be returned.
+        # Attention: In create mode documents of other customers
+        # can be assigned. ConstraintNotSatisfied is not raised.
+        user_id = getattr(context, 'user_id', None)
+        # Alternative implementation:
+        #if not user_id:
+        #    return []
         catalog = getUtility(ICatalog, name='documents_catalog')
         results = catalog.searchResults(user_id=(user_id, user_id))
