Odoo Help


What is KeyError: 'string' in import?

Anirudh Lou
on 1/2/15, 2:45 AM 1,602 views

Hello everyone, anyone can explain why it is happening? I have module that includes human resource, now when i import employees an error pops up saying:

File "/opt/openerp/server-7/openerp/addons/base_import/models.py", line 104, in get_fields
    'string': field['string'],
KeyError: 'string'

I tried to change 'string': field['string'] ;which is found on the default module, into field.get('string') but here what the UI says:

Import preview failed due to: 'NoneType' object has no attribute 'lower'. The issue is usually an incorrect file encoding.

Any help is much appreciate.


Hello Anirudh Lou, Don't change the field['string'] as that does appear to be correct. a) Some questions: Did it work before and does not work now? If so, what was types of changes occurred in that between time? b) Check the data you are loading, particularly check the header fields. Then just try and load one row. Same error?

on 1/2/15, 3:11 AM

In my other module and other import, it works but not when importing employee and now i notice that even the export also pops up an error, here it says: name = parent_name + (parent_name and '/' or '') + field['string'] KeyError: 'string'

Anirudh Lou
on 1/2/15, 3:20 AM

yeah, i return back to it's original code the field['string']

Anirudh Lou
on 1/2/15, 3:22 AM

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 1/2/15, 4:41 PM

Hello Anirudh Lou,

It seems the problem is in your custom module(s).

As per the error, I have doubt that one of your fields in your custom module(s) doesn't have string (label) which causes the error.

In your module it would be like fields.char() instead of fields.char("My Field").

Hope my guess is right and it will help you.

Thanks sir for the help. :)

Anirudh Lou
on 1/4/15, 7:19 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 1/2/15, 2:45 AM
Seen: 1602 times
Last updated: 3/16/15, 8:10 AM