Odoo Help


This community 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.


TypeError: type() argument 1 must be string, not None

Jeff Beidler
on 11/4/14, 6:45 PM 2,810 views

I've created a few simple modules, and never had this problem before.  This is the first time I've tried adding a new class/table to the database, though.  It seems pretty straightforward, but I keep getting this error when trying to install my new module:

Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 500, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 517, in dispatch result = self._call_function(**self.params) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 283, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 280, in checked_call return self.endpoint(*a, **kw) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 733, in __call__ return self.method(*args, **kw) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 376, in response_wrap response = f(*args, **kw) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/addons/web/controllers/main.py", line 948, in call_button action = self._call_kw(model, method, args, {}) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/addons/web/controllers/main.py", line 936, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/addons/base/module/module.py", line 450, in button_immediate_install return self._button_immediate_function(cr, uid, ids, self.button_install, context=context) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/addons/base/module/module.py", line 498, in _button_immediate_function registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/modules/registry.py", line 324, in new openerp.modules.load_modules(registry._db, force_demo, status, update_module) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/modules/loading.py", line 358, in load_modules loaded_modules, update_module) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/modules/loading.py", line 263, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/modules/loading.py", line 158, in load_module_graph models = registry.load(cr, package) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/modules/registry.py", line 147, in load model = cls._build_model(self, cr) File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/models.py", line 650, in _build_model cls = type(cls._name, (cls,), attrs) TypeError: type() argument 1 must be string, not None

What does "TypeError: type() argument 1 must be string, not None" mean?  I can't see anything specific about my module files that it's complaining about.

Jeff Beidler
On 11/4/14, 6:58 PM

Turns out it was the _name field in my class definition.  Don't leave that out!  :)

Good find :) . Just mark your own answer as the valid one, so this won't appear in the list of active questions.

Ludo - Neobis
on 11/5/14, 3:40 AM

I would, but the site doesn't seem to want to let me. It hasn't been giving me any karma points for questions and answers lately, either.

Jeff Beidler
on 11/5/14, 11:22 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 11/4/14, 6:45 PM
Seen: 2810 times
Last updated: 3/16/15, 8:10 AM