Merge lp:~openerp-dev/openobject-addons/6.0-opw-573311-rgo into lp:openobject-addons/6.0

Proposed by Ravi Gohil (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 5181
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-573311-rgo
Merge into: lp:openobject-addons/6.0
Diff against target: 37 lines (+4/-2)
1 file modified
account_coda/wizard/account_coda_import.py (+4/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-573311-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+100583@code.launchpad.net

Description of the change

Hello,

System throws Traceback when we import a coda file that has accented characters.

This fix fixes the issue. Kindly review it.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

5181. By Ravi Gohil (OpenERP)

[FIX] account_coda: When importing a coda file having accented characters in it, a traceback is caused: (Maintenance Case : 573311)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_coda/wizard/account_coda_import.py'
2--- account_coda/wizard/account_coda_import.py 2011-01-14 00:11:01 +0000
3+++ account_coda/wizard/account_coda_import.py 2012-04-03 10:57:19 +0000
4@@ -22,6 +22,7 @@
5
6 import time
7 import base64
8+import tools
9
10 from osv import fields, osv
11 from tools.translate import _
12@@ -90,6 +91,7 @@
13 recordlist = base64.decodestring(codafile).split('\n')
14 recordlist.pop()
15 for line in recordlist:
16+ line = tools.ustr(line)
17 if line[0] == '0':
18 # header data
19
20@@ -108,7 +110,7 @@
21 bank_statement["balance_start"]= bal_start
22 bank_statement["acc_number"]=line[5:17]
23 bank_statement["acc_holder"]=line[64:90]
24- bank_statement['name'] = journal_code + ' ' + str(line[2:5])
25+ bank_statement['name'] = journal_code + ' ' + line[2:5]
26
27 elif line[0]=='2':
28 # movement data record 2
29@@ -149,7 +151,7 @@
30 elif line[1] == '3':
31 # movement data record 3.1
32 st_line_name = line[2:6]
33- st_line_partner_acc = str(line[10:47]).strip()
34+ st_line_partner_acc = line[10:47].strip()
35 cntry_number=line[10:47].strip()
36 contry_name=line[47:125].strip()
37 bank_ids = partner_bank_obj.search(cr, uid, [('acc_number', '=', st_line_partner_acc)])