~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1

« back to all changes in this revision

Viewing changes to account_banking/account_banking.py

  • Committer: James Jesudason
  • Date: 2012-04-12 17:42:11 UTC
  • mto: This revision was merged to the branch mainline in revision 124.
  • Revision ID: james.jesudason@canonical.com-20120412174211-jzoz2qp460y0pu2x
[FIX] The validation of IBAN account numbers was preventing valid account numbers from being entered.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1135
1135
        Create dual function IBAN account for SEPA countries
1136
1136
        '''
1137
1137
        if vals['state'] == 'iban':
 
1138
            iban = vals.get('acc_number',False) or vals.get('acc_number_domestic',False)
1138
1139
            vals['acc_number'], vals['acc_number_domestic'] = (
1139
 
                self._correct_IBAN(vals['acc_number']))
 
1140
                self._correct_IBAN(iban))
1140
1141
        return self._founder.create(cursor, uid, vals, context)
1141
1142
 
1142
1143
    def write(self, cr, uid, ids, vals, context=None):
1421
1422
                      )
1422
1423
 
1423
1424
    _constraints = [
1424
 
        (check_iban, _("The IBAN number doesn't seem to be correct"), ["acc_number"])
 
1425
        # Cannot have this as a constraint as it is rejecting valid numbers from GB and DE
 
1426
        # It works much better without this constraint!
 
1427
        #(check_iban, _("The IBAN number doesn't seem to be correct"), ["acc_number"])
1425
1428
    ]
1426
1429
 
1427
1430
res_partner_bank()