From 10fbcafa0366bff92d3a77f966408cb9c5e84a6a Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 30 Mar 2011 11:48:09 +0530 Subject: [PATCH] [FIX] Account:Account chart wizard does not check if generated account code for bank journal exsits bzr revid: ara@tinyerp.com-20110330061809-3b28ug6dz37tq23v --- addons/account/account.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index def72ec08d3..e25ec7fa08c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2930,18 +2930,13 @@ class wizard_multi_charts_accounts(osv.osv_memory): while valid: try: new_code = str(int(ref_acc_bank.code.ljust(dig, '0')) + current_num) - ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) - if not ids: - valid = False - else: - current_num += 1 except: new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)), '0')) + str(current_num) - ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) - if not ids: - valid = False - else: - current_num += 1 + ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) + if not ids: + valid = False + else: + current_num += 1 vals = { 'name': tmp, 'currency_id': line.currency_id and line.currency_id.id or False,