From 4b347894cef639f87a1c59eb43907d04609407e1 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 8 Mar 2012 11:18:13 +0100 Subject: [PATCH] [FIX] Adapt to field 'code' no longer present on res.bank in 6.1 [FIX] Do not automatically create res.bank from online lookups when no BIC, as res.bank is not required on res.partner.bank anymore in 6.1. [FIX] Add field 'state' to statement line form as used by webclient to determine readonly property of some other fields --- account_banking/account_banking.py | 1 - account_banking/account_banking_view.xml | 1 + account_banking/wizard/banktools.py | 29 ------------------------ 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/account_banking/account_banking.py b/account_banking/account_banking.py index d25ed921f..146e4c525 100644 --- a/account_banking/account_banking.py +++ b/account_banking/account_banking.py @@ -1457,7 +1457,6 @@ class res_bank(osv.osv): # Only the first eight positions of BIC are used for bank # transfers, so ditch the rest. bic = info.bic[:8], - code = info.code, street = address.street, street2 = address.has_key('street2') and address.street2 or False, diff --git a/account_banking/account_banking_view.xml b/account_banking/account_banking_view.xml index ae06e0af3..484866c15 100644 --- a/account_banking/account_banking_view.xml +++ b/account_banking/account_banking_view.xml @@ -297,6 +297,7 @@ + diff --git a/account_banking/wizard/banktools.py b/account_banking/wizard/banktools.py index 6e7ef472b..49ba3bf48 100644 --- a/account_banking/wizard/banktools.py +++ b/account_banking/wizard/banktools.py @@ -374,35 +374,6 @@ def create_bank_account(pool, cursor, uid, partner_id, if bic: values.bank = get_or_create_bank(pool, cursor, uid, bic)[0] - else: - if not bankcode: - bankcode = "UNKNOW" - # Try to link bank - bank_obj = pool.get('res.bank') - bank_ids = bank_obj.search(cursor, uid, [ - ('code', 'ilike', bankcode) - ]) - if bank_ids: - # Check BIC on existing banks - values.bank = bank_ids[0] - bank = bank_obj.browse(cursor, uid, values.bank) - if not bank.bic: - bank_obj.write(cursor, uid, values.bank, dict(bic=bic)) - else: - # New bank - create - res = struct(country_id=country_id) - if account_info: - res.code = account_info.code - # Only the first eight positions of BIC are used for bank - # transfers, so ditch the rest. - res.bic = account_info.bic[:8] - res.name = account_info.bank - else: - res.code = bankcode - res.name = _('Unknown Bank') - - values.bank = bank_obj.create(cursor, uid, res) - # Create bank account and return return pool.get('res.partner.bank').create(cursor, uid, values)