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.


AttributeError: 'NoneType' object has no attribute '_table'

on 7/17/13, 8:15 AM 13,956 views

Hi please tell me how to fix this error:

Server Traceback (most recent call last): File "/home/erp_user/openerp/production/server/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/home/erp_user/openerp/production/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/home/erp_user/openerp/production/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/home/erp_user/openerp/production/server/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/home/erp_user/openerp/production/server/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/home/erp_user/openerp/production/server/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/home/erp_user/openerp/production/server/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/home/erp_user/openerp/production/server/openerp/addons/base/module/module.py", line 495, in button_immediate_uninstall return self._button_immediate_function(cr, uid, ids, self.button_uninstall, context=context) File "/home/erp_user/openerp/production/server/openerp/addons/base/module/module.py", line 475, in _button_immediate_function _, pool = pooler.restart_pool(cr.dbname, update_module=True) File "/home/erp_user/openerp/production/server/openerp/pooler.py", line 39, in restart_pool registry = RegistryManager.new(db_name, force_demo, status, update_module) File "/home/erp_user/openerp/production/server/openerp/modules/registry.py", line 218, in new openerp.modules.load_modules(registry.db, force_demo, status, update_module) File "/home/erp_user/openerp/production/server/openerp/modules/loading.py", line 413, in load_modules pool.get('ir.module.module').module_uninstall(cr, SUPERUSER_ID, mod_ids_to_remove) File "/home/erp_user/openerp/production/server/openerp/addons/base/module/module.py", line 439, in module_uninstall ir_model_constraint._module_data_uninstall(cr, uid, constraint_ids, context) File "/home/erp_user/openerp/production/server/openerp/addons/base/ir/ir_model.py", line 532, in _module_data_uninstall WHERE cs.contype=%s and cs.conname=%s and cl.relname=%s""", ('f', name, model_obj._table)) AttributeError: 'NoneType' object has no attribute '_table'

On 7/17/13, 2:11 PM

IS this error came while you upgrading any module ....??

If yes then there may be various chance for this error but meanwhile open PGAdmin and run this command and then proceed ....

Update ir_module_module set state='installed' where state='to upgrade'

On 2/1/16, 5:09 AM

I had this error on one of my module, where a many2many field was linking to a model, whose module was not added on the depends list in the __openerp__.py. So try to check your custom module to see if there is any relationship between your custom module and other module. Then add the module to the "depends" list in the __openerp__.py file. 

On 8/2/13, 4:04 AM

thank you for your answer, this error message comes especially if I try to uninstall my module, how can i solve this problem?

On 7/14/14, 10:28 AM

I had the same problem with addons-hr-ng modules. Some time in the past we installed these modules directly in /openerp/openerp/addons.

Later on we moved these addons in an external directory called /opt/addons/addons-hr-ng. Since then hr modules didn't work, could not install/uninstall and the above error occured. We even tried moving the addons-hr-ng directory in /openerp/openerp/addons but still same errors. 

Only moving back the modules from /opt/addons/addons-hr-ng/<modules> into /openerp/openerp/addons resolved the issue.

Seems there is no way of moving the modules location once installed.

yassine chaouche
On 3/4/14, 5:42 PM

Upgrading base module will get rid of old references in the database and may help in uninstalling your module.

If that still doesn't work, you can try this standalone script at your own risk. Make a backup http://ychaouche.wikispot.org/OpenERPModuleRemover

The link to the script you recomend is dead

Julio Cesar Rodriguez
on 10/6/15, 11:41 AM

Luckily, the [Internet Archive](https://web.archive.org/web/20150705113707/http://ychaouche.wikispot.org/OpenERPModuleRemover) got my back

yassine chaouche
on 2/1/16, 6:52 AM
On 8/26/14, 11:47 PM

set uninstall to you module. then reinstall will be ok 

Update ir_module_module set state='uninstall' where state='to upgrade'

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

3 follower(s)


Asked: 7/17/13, 8:15 AM
Seen: 13956 times
Last updated: 8/18/16, 5:45 AM