[IMP] base_import: match column names withtout check the case

If you try to import a file with a header 'Parent_id/id'
_match_header will not match Parent_id with parent_id
because it was comparing with case sensitive.

It's not a bug, but in most cases this new behaviour (non
sensitive case search) is what the end user was expected.

Hate Excel and the auto correct capitalization !
This commit is contained in:
Jeremy Kersten 2015-03-26 10:09:31 +01:00 committed by Martin Trigaux
parent 6ef068a811
commit b9adcc7598
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class ir_import(orm.TransientModel):
for field in fields:
# FIXME: should match all translations & original
# TODO: use string distance (levenshtein? hamming?)
if header == field['name'] \
if header.lower() == field['name'].lower() \
or header.lower() == field['string'].lower():
return [field]