Index: /main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py
===================================================================
--- /main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py	(revision 12790)
+++ /main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py	(revision 12791)
@@ -25,5 +25,9 @@
     validate_email)
 from waeup.ikoba.customers.vocabularies import (
-    ConCatProductSource, CustomerDocumentSource, nats_vocab)
+    ConCatProductSource,
+    CustomerDocumentSource,
+    RefereeSourceFactory,
+    nats_vocab,
+    )
 from waeup.ikoba.schema import TextLineChoice, FormattedDate, PhoneNumber
 from waeup.ikoba.products.productoptions import ProductOptionField
@@ -64,4 +68,9 @@
         )
 
+    res_address = schema.Text(
+        title = _(u'Residential Address'),
+        required = True,
+        )
+
 # Customer document interfaces
 
@@ -100,9 +109,4 @@
         required = True,
         values = year_range(),
-        )
-
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
-        required = True,
         )
 
@@ -207,9 +211,4 @@
         )
 
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
-        required = False,
-        )
-
     last_license_number = schema.TextLine(
         title = _(u'Last Annual License Number'),
@@ -300,9 +299,4 @@
         vocabulary = nats_vocab,
         title = _(u'State of Origin'),
-        required = False,
-        )
-
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
         required = False,
         )
@@ -331,39 +325,14 @@
         )
 
-    referee1_name = schema.TextLine(
-        title = _(u'First Referee Name'),
-        description= _('This referee must be a pharmacist.'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_address = schema.Text(
-        title = _(u'First Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_license = schema.TextLine(
-        title = _(u'First Referee License Number'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_name = schema.TextLine(
-        title = _(u'Second Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_address = schema.Text(
-        title = _(u'Second Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_license = schema.TextLine(
-        title = _(u'Second Referee License Number'),
-        required = False,
-        readonly = False,
+    referees = schema.List(
+        title = _(u'Referees'),
+        value_type = schema.Choice(
+            source=RefereeSourceFactory(),
+            required = True,
+            ),
+        description = u'Add at least two referees from the PCN database.',
+        required = False,
+        readonly = False,
+        default = [],
         )
 
@@ -436,9 +405,4 @@
         )
 
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
-        required = False,
-        )
-
     qualifications = schema.Text(
         title = _(u'Qualifications'),
@@ -457,38 +421,14 @@
         )
 
-    referee1_name = schema.TextLine(
-        title = _(u'First Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_address = schema.Text(
-        title = _(u'First Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_license = schema.TextLine(
-        title = _(u'First Referee License Number'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_name = schema.TextLine(
-        title = _(u'Second Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_address = schema.Text(
-        title = _(u'Second Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_license = schema.TextLine(
-        title = _(u'Second Referee License Number'),
-        required = False,
-        readonly = False,
+    referees = schema.List(
+        title = _(u'Referees'),
+        value_type = schema.Choice(
+            source=RefereeSourceFactory(),
+            required = True,
+            ),
+        description = u'Add at least two referees from the PCN database.',
+        required = False,
+        readonly = False,
+        default = [],
         )
 
@@ -562,9 +502,4 @@
     """
 
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
-        required = False,
-        )
-
     occupation = schema.TextLine(
         title = _(u'Occupation'),
@@ -635,50 +570,14 @@
         )
 
-    referee1_name = schema.TextLine(
-        title = _(u'First Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_address = schema.Text(
-        title = _(u'First Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_license = schema.TextLine(
-        title = _(u'First Referee License Number'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_occupation = schema.TextLine(
-        title = _(u'First Referee Occupation'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_name = schema.TextLine(
-        title = _(u'Second Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_address = schema.Text(
-        title = _(u'Second Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_license = schema.TextLine(
-        title = _(u'Second Referee License Number'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_occupation = schema.TextLine(
-        title = _(u'Second Referee Occupation'),
-        required = False,
-        readonly = False,
+    referees = schema.List(
+        title = _(u'Referees'),
+        value_type = schema.Choice(
+            source=RefereeSourceFactory(),
+            required = True,
+            ),
+        description = u'Add at least two referees from the PCN database.',
+        required = False,
+        readonly = False,
+        default = [],
         )
 
@@ -741,9 +640,4 @@
     """
 
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
-        required = False,
-        )
-
     occupation = schema.TextLine(
         title = _(u'Occupation'),
@@ -796,52 +690,15 @@
         )
 
-    referee1_name = schema.TextLine(
-        title = _(u'First Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_address = schema.Text(
-        title = _(u'First Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_license = schema.TextLine(
-        title = _(u'First Referee License Number'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_occupation = schema.TextLine(
-        title = _(u'First Referee Occupation'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_name = schema.TextLine(
-        title = _(u'Second Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_address = schema.Text(
-        title = _(u'Second Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_license = schema.TextLine(
-        title = _(u'Second Referee License Number'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_occupation = schema.TextLine(
-        title = _(u'Second Referee Occupation'),
-        required = False,
-        readonly = False,
-        )
-
+    referees = schema.List(
+        title = _(u'Referees'),
+        value_type = schema.Choice(
+            source=RefereeSourceFactory(),
+            required = True,
+            ),
+        description = u'Add at least two referees from the PCN database.',
+        required = False,
+        readonly = False,
+        default = [],
+        )
 
 class IRPPMVLContractOfficialUse(IIkobaObject):
@@ -1053,9 +910,4 @@
     home_address = schema.Text(
         title = _(u'Permanent Home Address'),
-        required = False,
-        )
-
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
         required = False,
         )
@@ -1078,29 +930,15 @@
         )
 
-    referee1_name = schema.TextLine(
-        title = _(u'First Referee Name'),
-        description= _('This referee must be a pharmacist.'),
-        required = False,
-        readonly = False,
-        )
-
-    referee1_address = schema.Text(
-        title = _(u'First Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_name = schema.TextLine(
-        title = _(u'Second Referee Name'),
-        required = False,
-        readonly = False,
-        )
-
-    referee2_address = schema.Text(
-        title = _(u'Second Referee Address'),
-        required = False,
-        readonly = False,
-        )
-
+    referees = schema.List(
+        title = _(u'Referees'),
+        value_type = schema.Choice(
+            source=RefereeSourceFactory(),
+            required = True,
+            ),
+        description = u'Add at least two referees from the PCN database.',
+        required = False,
+        readonly = False,
+        default = [],
+        )
 
 class IRPTContractOfficialUse(IIkobaObject):
@@ -1151,9 +989,4 @@
     office_address = schema.Text(
         title = _(u'Offices or Business Address'),
-        required = False,
-        )
-
-    res_address = schema.Text(
-        title = _(u'Residential Address'),
         required = False,
         )
Index: /main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py
===================================================================
--- /main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py	(revision 12790)
+++ /main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py	(revision 12791)
@@ -63,4 +63,5 @@
         customer.sex = u'f'
         customer.email = u'aa@aa.aa'
+        customer.res_address = u'My address'
         customer.date_of_birth = datetime.date(1981, 2, 4)
         IWorkflowState(customer).setState('started')
@@ -95,6 +96,6 @@
         self.assertEqual(result,
             'customer_id,date_of_birth,email,firstname,lastname,middlename,phone,'
-            'reg_number,sex,suspended,suspended_comment,password,state,history\r\n'
-            'K1000000,1981-02-04#,aa@aa.aa,Beate,Mueller,,,123,f,0,,,started,[]\r\n')
+            'reg_number,res_address,sex,suspended,suspended_comment,password,state,history\r\n'
+            'K1000000,1981-02-04#,aa@aa.aa,Beate,Mueller,,,123,My address,f,0,,,started,[]\r\n')
         # We can reimport the file ...
         processor = PCNCustomerProcessor()
@@ -102,5 +103,5 @@
             self.outfile,
             ['customer_id','date_of_birth','email','firstname','lastname','middlename','phone',
-            'reg_number','sex','suspended','suspended_comment','password','state'],
+            'reg_number','res_address','sex','suspended','suspended_comment','password','state'],
             mode='create')
         num, num_fail, finished_path, failed_path = result
@@ -111,5 +112,5 @@
             self.outfile,
             ['customer_id','date_of_birth','email','firstname','lastname','middlename','phone',
-            'reg_number','sex','suspended','suspended_comment','password','state'],
+            'reg_number','res_address','sex','suspended','suspended_comment','password','state'],
             mode='create')
         num_succ, num_fail, finished_path, failed_path = result
@@ -120,5 +121,5 @@
             self.outfile,
             ['customer_id','date_of_birth','xx_email','firstname','lastname','middlename','phone',
-            'xx_reg_number','sex','suspended','suspended_comment','password','state'],
+            'xx_reg_number','res_address','sex','suspended','suspended_comment','password','state'],
             mode='update')
         num_succ, num_fail, finished_path, failed_path = result
@@ -225,10 +226,10 @@
             'categories_practice,class_name,comment,contract_category,contract_id,'
             'fee_based,history,last_product_id,lga,product_object,'
-            'product_options,res_address,state,state_of_origin,superintendent,'
+            'product_options,state,state_of_origin,superintendent,'
             'tc_dict,title,user_id,valid_from,valid_to,work_address,work_email,work_phone,'
             'year_qualification\r\n'
             '[],RONContract,,ron,%s,0,'
             '[u\'2015-01-18 16:40:01 WAT - License created by system\'],,,,'
-            '[],,created,,,{\'en\': u\'Hello World\'},,K1000000,,,,,,\r\n'
+            '[],created,,,{\'en\': u\'Hello World\'},,K1000000,,,,,,\r\n'
             % self.contract1.contract_id)
         # We can reimport the file if we change the header
@@ -286,5 +287,5 @@
             'last_product_id,official_in_state,other_directors,'
             'pharmacists_directors,premises_address,premises_certificate,'
-            'product_object,product_options,recommended,res_address,'
+            'product_object,product_options,recommended,'
             'state,superintendent,tc_dict,title,user_id,valid_from,valid_to,'
             'work_address\r\n'
@@ -292,5 +293,5 @@
             '[],ROPContract,rop,%s,,0,'
             '[u\'2015-01-20 18:51:03 WAT - License created by system\']'
-            ',,,,,,,,,,[],,,created,,{\'en\': u\'Hello World\'},,K1000000,,,\r\n'
+            ',,,,,,,,,,[],,created,,{\'en\': u\'Hello World\'},,K1000000,,,\r\n'
             % self.contract2.contract_id)
         # We can reimport the file if we change the header
@@ -357,4 +358,5 @@
         self.browser.getLink("Edit").click()
         self.browser.getControl(name="form.email").value = 'new_email@aa.ng'
+        self.browser.getControl(name="form.res_address").value = 'My address'
         self.browser.getControl("Save", index=0).click()
         self.assertMatches('...Form has been saved...',
