From 1ac1a6508a5b81f02e436eceeb2fbfbdb84810e8 Mon Sep 17 00:00:00 2001 From: "dle@openerp.com" <> Date: Tue, 18 Dec 2012 12:01:05 +0100 Subject: [PATCH] [FIX]Replace missplaced bzr revid: dle@openerp.com-20121218110105-pt18zaefasmkiaky --- addons/l10n_be_coda/wizard/account_coda_import.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_be_coda/wizard/account_coda_import.py b/addons/l10n_be_coda/wizard/account_coda_import.py index f3d21064276..05dd7d5141c 100644 --- a/addons/l10n_be_coda/wizard/account_coda_import.py +++ b/addons/l10n_be_coda/wizard/account_coda_import.py @@ -102,13 +102,13 @@ class account_coda_import(osv.osv_memory): The following request try to find the Account Number using a 'like' operator. So, if the Account Number is stored with IBAN code, it can be found thanks to this. """ - cr.execute("select id from res_partner_bank where replace('-','',replace(acc_number,' ','')) like %s", ('%' + statement['acc_number'] + '%',)) + cr.execute("select id from res_partner_bank where replace(replace(acc_number,' ',''),'-','') like %s", ('%' + statement['acc_number'] + '%',)) else: """ This case is necessary to avoid cases like the Account Number in the CODA file is set to a single or few digits, 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'],)) + 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()] if bank_ids and len(bank_ids) > 0: bank_accs = self.pool.get('res.partner.bank').browse(cr, uid, bank_ids)