Ignore:
Timestamp:
19 Mar 2015, 06:49:45 (10 years ago)
Author:
Henrik Bettermann
Message:

Move res_address to customer. Replace all referee fields by new referee list field.

Location:
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12622 r12791  
    2525    validate_email)
    2626from waeup.ikoba.customers.vocabularies import (
    27     ConCatProductSource, CustomerDocumentSource, nats_vocab)
     27    ConCatProductSource,
     28    CustomerDocumentSource,
     29    RefereeSourceFactory,
     30    nats_vocab,
     31    )
    2832from waeup.ikoba.schema import TextLineChoice, FormattedDate, PhoneNumber
    2933from waeup.ikoba.products.productoptions import ProductOptionField
     
    6468        )
    6569
     70    res_address = schema.Text(
     71        title = _(u'Residential Address'),
     72        required = True,
     73        )
     74
    6675# Customer document interfaces
    6776
     
    100109        required = True,
    101110        values = year_range(),
    102         )
    103 
    104     res_address = schema.Text(
    105         title = _(u'Residential Address'),
    106         required = True,
    107111        )
    108112
     
    207211        )
    208212
    209     res_address = schema.Text(
    210         title = _(u'Residential Address'),
    211         required = False,
    212         )
    213 
    214213    last_license_number = schema.TextLine(
    215214        title = _(u'Last Annual License Number'),
     
    300299        vocabulary = nats_vocab,
    301300        title = _(u'State of Origin'),
    302         required = False,
    303         )
    304 
    305     res_address = schema.Text(
    306         title = _(u'Residential Address'),
    307301        required = False,
    308302        )
     
    331325        )
    332326
    333     referee1_name = schema.TextLine(
    334         title = _(u'First Referee Name'),
    335         description= _('This referee must be a pharmacist.'),
    336         required = False,
    337         readonly = False,
    338         )
    339 
    340     referee1_address = schema.Text(
    341         title = _(u'First Referee Address'),
    342         required = False,
    343         readonly = False,
    344         )
    345 
    346     referee1_license = schema.TextLine(
    347         title = _(u'First Referee License Number'),
    348         required = False,
    349         readonly = False,
    350         )
    351 
    352     referee2_name = schema.TextLine(
    353         title = _(u'Second Referee Name'),
    354         required = False,
    355         readonly = False,
    356         )
    357 
    358     referee2_address = schema.Text(
    359         title = _(u'Second Referee Address'),
    360         required = False,
    361         readonly = False,
    362         )
    363 
    364     referee2_license = schema.TextLine(
    365         title = _(u'Second Referee License Number'),
    366         required = False,
    367         readonly = False,
     327    referees = schema.List(
     328        title = _(u'Referees'),
     329        value_type = schema.Choice(
     330            source=RefereeSourceFactory(),
     331            required = True,
     332            ),
     333        description = u'Add at least two referees from the PCN database.',
     334        required = False,
     335        readonly = False,
     336        default = [],
    368337        )
    369338
     
    436405        )
    437406
    438     res_address = schema.Text(
    439         title = _(u'Residential Address'),
    440         required = False,
    441         )
    442 
    443407    qualifications = schema.Text(
    444408        title = _(u'Qualifications'),
     
    457421        )
    458422
    459     referee1_name = schema.TextLine(
    460         title = _(u'First Referee Name'),
    461         required = False,
    462         readonly = False,
    463         )
    464 
    465     referee1_address = schema.Text(
    466         title = _(u'First Referee Address'),
    467         required = False,
    468         readonly = False,
    469         )
    470 
    471     referee1_license = schema.TextLine(
    472         title = _(u'First Referee License Number'),
    473         required = False,
    474         readonly = False,
    475         )
    476 
    477     referee2_name = schema.TextLine(
    478         title = _(u'Second Referee Name'),
    479         required = False,
    480         readonly = False,
    481         )
    482 
    483     referee2_address = schema.Text(
    484         title = _(u'Second Referee Address'),
    485         required = False,
    486         readonly = False,
    487         )
    488 
    489     referee2_license = schema.TextLine(
    490         title = _(u'Second Referee License Number'),
    491         required = False,
    492         readonly = False,
     423    referees = schema.List(
     424        title = _(u'Referees'),
     425        value_type = schema.Choice(
     426            source=RefereeSourceFactory(),
     427            required = True,
     428            ),
     429        description = u'Add at least two referees from the PCN database.',
     430        required = False,
     431        readonly = False,
     432        default = [],
    493433        )
    494434
     
    562502    """
    563503
    564     res_address = schema.Text(
    565         title = _(u'Residential Address'),
    566         required = False,
    567         )
    568 
    569504    occupation = schema.TextLine(
    570505        title = _(u'Occupation'),
     
    635570        )
    636571
    637     referee1_name = schema.TextLine(
    638         title = _(u'First Referee Name'),
    639         required = False,
    640         readonly = False,
    641         )
    642 
    643     referee1_address = schema.Text(
    644         title = _(u'First Referee Address'),
    645         required = False,
    646         readonly = False,
    647         )
    648 
    649     referee1_license = schema.TextLine(
    650         title = _(u'First Referee License Number'),
    651         required = False,
    652         readonly = False,
    653         )
    654 
    655     referee1_occupation = schema.TextLine(
    656         title = _(u'First Referee Occupation'),
    657         required = False,
    658         readonly = False,
    659         )
    660 
    661     referee2_name = schema.TextLine(
    662         title = _(u'Second Referee Name'),
    663         required = False,
    664         readonly = False,
    665         )
    666 
    667     referee2_address = schema.Text(
    668         title = _(u'Second Referee Address'),
    669         required = False,
    670         readonly = False,
    671         )
    672 
    673     referee2_license = schema.TextLine(
    674         title = _(u'Second Referee License Number'),
    675         required = False,
    676         readonly = False,
    677         )
    678 
    679     referee2_occupation = schema.TextLine(
    680         title = _(u'Second Referee Occupation'),
    681         required = False,
    682         readonly = False,
     572    referees = schema.List(
     573        title = _(u'Referees'),
     574        value_type = schema.Choice(
     575            source=RefereeSourceFactory(),
     576            required = True,
     577            ),
     578        description = u'Add at least two referees from the PCN database.',
     579        required = False,
     580        readonly = False,
     581        default = [],
    683582        )
    684583
     
    741640    """
    742641
    743     res_address = schema.Text(
    744         title = _(u'Residential Address'),
    745         required = False,
    746         )
    747 
    748642    occupation = schema.TextLine(
    749643        title = _(u'Occupation'),
     
    796690        )
    797691
    798     referee1_name = schema.TextLine(
    799         title = _(u'First Referee Name'),
    800         required = False,
    801         readonly = False,
    802         )
    803 
    804     referee1_address = schema.Text(
    805         title = _(u'First Referee Address'),
    806         required = False,
    807         readonly = False,
    808         )
    809 
    810     referee1_license = schema.TextLine(
    811         title = _(u'First Referee License Number'),
    812         required = False,
    813         readonly = False,
    814         )
    815 
    816     referee1_occupation = schema.TextLine(
    817         title = _(u'First Referee Occupation'),
    818         required = False,
    819         readonly = False,
    820         )
    821 
    822     referee2_name = schema.TextLine(
    823         title = _(u'Second Referee Name'),
    824         required = False,
    825         readonly = False,
    826         )
    827 
    828     referee2_address = schema.Text(
    829         title = _(u'Second Referee Address'),
    830         required = False,
    831         readonly = False,
    832         )
    833 
    834     referee2_license = schema.TextLine(
    835         title = _(u'Second Referee License Number'),
    836         required = False,
    837         readonly = False,
    838         )
    839 
    840     referee2_occupation = schema.TextLine(
    841         title = _(u'Second Referee Occupation'),
    842         required = False,
    843         readonly = False,
    844         )
    845 
     692    referees = schema.List(
     693        title = _(u'Referees'),
     694        value_type = schema.Choice(
     695            source=RefereeSourceFactory(),
     696            required = True,
     697            ),
     698        description = u'Add at least two referees from the PCN database.',
     699        required = False,
     700        readonly = False,
     701        default = [],
     702        )
    846703
    847704class IRPPMVLContractOfficialUse(IIkobaObject):
     
    1053910    home_address = schema.Text(
    1054911        title = _(u'Permanent Home Address'),
    1055         required = False,
    1056         )
    1057 
    1058     res_address = schema.Text(
    1059         title = _(u'Residential Address'),
    1060912        required = False,
    1061913        )
     
    1078930        )
    1079931
    1080     referee1_name = schema.TextLine(
    1081         title = _(u'First Referee Name'),
    1082         description= _('This referee must be a pharmacist.'),
    1083         required = False,
    1084         readonly = False,
    1085         )
    1086 
    1087     referee1_address = schema.Text(
    1088         title = _(u'First Referee Address'),
    1089         required = False,
    1090         readonly = False,
    1091         )
    1092 
    1093     referee2_name = schema.TextLine(
    1094         title = _(u'Second Referee Name'),
    1095         required = False,
    1096         readonly = False,
    1097         )
    1098 
    1099     referee2_address = schema.Text(
    1100         title = _(u'Second Referee Address'),
    1101         required = False,
    1102         readonly = False,
    1103         )
    1104 
     932    referees = schema.List(
     933        title = _(u'Referees'),
     934        value_type = schema.Choice(
     935            source=RefereeSourceFactory(),
     936            required = True,
     937            ),
     938        description = u'Add at least two referees from the PCN database.',
     939        required = False,
     940        readonly = False,
     941        default = [],
     942        )
    1105943
    1106944class IRPTContractOfficialUse(IIkobaObject):
     
    1151989    office_address = schema.Text(
    1152990        title = _(u'Offices or Business Address'),
    1153         required = False,
    1154         )
    1155 
    1156     res_address = schema.Text(
    1157         title = _(u'Residential Address'),
    1158991        required = False,
    1159992        )
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py

    r12666 r12791  
    6363        customer.sex = u'f'
    6464        customer.email = u'aa@aa.aa'
     65        customer.res_address = u'My address'
    6566        customer.date_of_birth = datetime.date(1981, 2, 4)
    6667        IWorkflowState(customer).setState('started')
     
    9596        self.assertEqual(result,
    9697            'customer_id,date_of_birth,email,firstname,lastname,middlename,phone,'
    97             'reg_number,sex,suspended,suspended_comment,password,state,history\r\n'
    98             'K1000000,1981-02-04#,aa@aa.aa,Beate,Mueller,,,123,f,0,,,started,[]\r\n')
     98            'reg_number,res_address,sex,suspended,suspended_comment,password,state,history\r\n'
     99            'K1000000,1981-02-04#,aa@aa.aa,Beate,Mueller,,,123,My address,f,0,,,started,[]\r\n')
    99100        # We can reimport the file ...
    100101        processor = PCNCustomerProcessor()
     
    102103            self.outfile,
    103104            ['customer_id','date_of_birth','email','firstname','lastname','middlename','phone',
    104             'reg_number','sex','suspended','suspended_comment','password','state'],
     105            'reg_number','res_address','sex','suspended','suspended_comment','password','state'],
    105106            mode='create')
    106107        num, num_fail, finished_path, failed_path = result
     
    111112            self.outfile,
    112113            ['customer_id','date_of_birth','email','firstname','lastname','middlename','phone',
    113             'reg_number','sex','suspended','suspended_comment','password','state'],
     114            'reg_number','res_address','sex','suspended','suspended_comment','password','state'],
    114115            mode='create')
    115116        num_succ, num_fail, finished_path, failed_path = result
     
    120121            self.outfile,
    121122            ['customer_id','date_of_birth','xx_email','firstname','lastname','middlename','phone',
    122             'xx_reg_number','sex','suspended','suspended_comment','password','state'],
     123            'xx_reg_number','res_address','sex','suspended','suspended_comment','password','state'],
    123124            mode='update')
    124125        num_succ, num_fail, finished_path, failed_path = result
     
    225226            'categories_practice,class_name,comment,contract_category,contract_id,'
    226227            'fee_based,history,last_product_id,lga,product_object,'
    227             'product_options,res_address,state,state_of_origin,superintendent,'
     228            'product_options,state,state_of_origin,superintendent,'
    228229            'tc_dict,title,user_id,valid_from,valid_to,work_address,work_email,work_phone,'
    229230            'year_qualification\r\n'
    230231            '[],RONContract,,ron,%s,0,'
    231232            '[u\'2015-01-18 16:40:01 WAT - License created by system\'],,,,'
    232             '[],,created,,,{\'en\': u\'Hello World\'},,K1000000,,,,,,\r\n'
     233            '[],created,,,{\'en\': u\'Hello World\'},,K1000000,,,,,,\r\n'
    233234            % self.contract1.contract_id)
    234235        # We can reimport the file if we change the header
     
    286287            'last_product_id,official_in_state,other_directors,'
    287288            'pharmacists_directors,premises_address,premises_certificate,'
    288             'product_object,product_options,recommended,res_address,'
     289            'product_object,product_options,recommended,'
    289290            'state,superintendent,tc_dict,title,user_id,valid_from,valid_to,'
    290291            'work_address\r\n'
     
    292293            '[],ROPContract,rop,%s,,0,'
    293294            '[u\'2015-01-20 18:51:03 WAT - License created by system\']'
    294             ',,,,,,,,,,[],,,created,,{\'en\': u\'Hello World\'},,K1000000,,,\r\n'
     295            ',,,,,,,,,,[],,created,,{\'en\': u\'Hello World\'},,K1000000,,,\r\n'
    295296            % self.contract2.contract_id)
    296297        # We can reimport the file if we change the header
     
    357358        self.browser.getLink("Edit").click()
    358359        self.browser.getControl(name="form.email").value = 'new_email@aa.ng'
     360        self.browser.getControl(name="form.res_address").value = 'My address'
    359361        self.browser.getControl("Save", index=0).click()
    360362        self.assertMatches('...Form has been saved...',
Note: See TracChangeset for help on using the changeset viewer.