[FIX] base_import: strip line while importing
Empty line was already deleted but if you had a line with just a tab (\t) the line was imported with an exception "list index out of range"
This commit is contained in:
parent
7da3854597
commit
dab37df04d
|
@ -280,13 +280,13 @@ class ir_import(orm.TransientModel):
|
|||
if options.get('headers'):
|
||||
rows_to_import = itertools.islice(
|
||||
rows_to_import, 1, None)
|
||||
data = [
|
||||
row for row in itertools.imap(mapper, rows_to_import)
|
||||
# don't try inserting completely empty rows (e.g. from
|
||||
# filtering out o2m fields)
|
||||
if any(row)
|
||||
]
|
||||
|
||||
data = []
|
||||
for row in rows_to_import:
|
||||
# don't try inserting completely empty rows (e.g. from
|
||||
# filtering out o2m fields
|
||||
if any(f.strip() for f in row):
|
||||
data.append(mapper(row))
|
||||
return data, import_fields
|
||||
|
||||
def do(self, cr, uid, id, fields, options, dryrun=False, context=None):
|
||||
|
|
Loading…
Reference in New Issue