[FIX] l10n_be_coda: filter bank accounts which are not allowed

lp bug: https://launchpad.net/bugs/1128933 fixed

bzr revid: rha@tinyerp.com-20130222073656-k0wxo8x5jqbn0n41
This commit is contained in:
Niels Huylebroeck 2013-02-22 13:06:56 +05:30 committed by Rifakat
parent 99f63ac1f8
commit f50588b5c1
1 changed files with 2 additions and 0 deletions

View File

@ -117,6 +117,8 @@ class account_coda_import(osv.osv_memory):
# and so a 'like' operator would return the first account number in the database which matches.
cr.execute("select id from res_partner_bank where replace(replace(acc_number,' ',''),'-','') = %s", (statement['acc_number'],))
bank_ids = [id[0] for id in cr.fetchall()]
# Filter bank accounts which are not allowed
bank_ids = self.pool.get('res.partner.bank').search(cr, uid, [('id', 'in', bank_ids)])
if bank_ids and len(bank_ids) > 0:
bank_accs = self.pool.get('res.partner.bank').browse(cr, uid, bank_ids)
for bank_acc in bank_accs: