From c92cfc7659ca54865ca47cf87f589a084536a040 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 25 Jun 2009 12:37:19 +0530 Subject: [PATCH] [FIX] Account : Corrected bank journal code creation from template lp bug: https://launchpad.net/bugs/358302 fixed bzr revid: jvo@tinyerp.com-20090625070719-kkiah7hv27s3p3ij --- addons/account/account.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 2af75aec536..dad8832bda7 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2205,9 +2205,11 @@ class wizard_multi_charts_accounts(osv.osv_memory): #create the account_account for this bank journal tmp = self.pool.get('res.partner.bank').name_get(cr, uid, [line.acc_no.id])[0][1] dig = obj_multi.code_digits - new_code = str(current_num) if ref_acc_bank.code: - new_code = str(ref_acc_bank.code.ljust(dig,'0') + str(current_num)) + try: + new_code = str(int(ref_acc_bank.code.ljust(dig,'0')) + current_num) + except Exception,e: + new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)),'0')) + str(current_num) vals = { 'name': line.acc_no.bank and line.acc_no.bank.name+' '+tmp or tmp, 'currency_id': line.currency_id and line.currency_id.id or False,