Csv import : bugfix of convert_csv_import(): one line was ignored every commit

bzr revid: bch-2c45d9af534656d68b690e7185f4bcd981268928
This commit is contained in:
bch 2007-04-05 14:02:28 +00:00
parent 20af94011f
commit 8b21a392de
1 changed files with 3 additions and 3 deletions

View File

@ -395,15 +395,15 @@ def convert_csv_import(cr, module, fname, csvcontent, idref={}, mode='init'):
uid = 1
datas = []
for line in data:
for line in reader:
datas.append( map(lambda x:x.decode('utf8').encode('utf8'), line))
if len(datas) > COMMIT_STEP:
pool.get(model).import_data(cr, uid, data[0], datas[1:])
pool.get(model).import_data(cr, uid, fields, datas)
cr.commit()
datas=[]
if datas:
pool.get(model).import_data(cr, uid, data[0], datas[1:])
pool.get(model).import_data(cr, uid, fields, datas)
cr.commit()
#