Odoo Help

Welcome!

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.

0

AttributeError: 'NoneType' object has no attribute '_table' error when trying to uninstall a module

By
sneha antony
on 3/4/14, 9:17 AM 3,129 views

I met with the following error when I tried to uninstall a module from openerp interface

Client Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, *self.params) File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1129, in call_button action = self._call_kw(req, model, method, args, {}) File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1117, in _call_kw return getattr(req.session.model(model), method)(args, **kwargs) File "/opt/openerp/server/openerp/addons/web/session.py", line 42, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/opt/openerp/server/openerp/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "/opt/openerp/server/openerp/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/opt/openerp/server/openerp/osv/osv.py", line 190, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/opt/openerp/server/openerp/osv/osv.py", line 132, in wrapper return f(self, dbname, args, *kwargs) File "/opt/openerp/server/openerp/osv/osv.py", line 199, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/opt/openerp/server/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/opt/openerp/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 "/opt/openerp/server/openerp/addons/base/module/module.py", line 475, in _button_immediate_function _, pool = pooler.restart_pool(cr.dbname, update_module=True) File "/opt/openerp/server/openerp/pooler.py", line 39, in restart_pool registry = RegistryManager.new(db_name, force_demo, status, update_module) File "/opt/openerp/server/openerp/modules/registry.py", line 219, in new openerp.modules.load_modules(registry.db, force_demo, status, update_module) File "/opt/openerp/server/openerp/modules/loading.py", line 421, in load_modules pool.get('ir.module.module').module_uninstall(cr, SUPERUSER_ID, mod_ids_to_remove) File "/opt/openerp/server/openerp/addons/base/module/module.py", line 439, in module_uninstall ir_model_constraint._module_data_uninstall(cr, uid, constraint_ids, context) File "/opt/openerp/server/openerp/addons/base/ir/ir_model.py", line 536, 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'.

But the module which I am trying to remove is not in the /OPT/OPENERP/SERVER/OPENERP/ADDONS directory.It has been already removed.Can anyone please help in sorting out this issue?

0

Gopakumar N G

--Gopakumar N G--
1198
| 5 3 7
Cochin, India
--Gopakumar N G--

Senior Software Engineer at BroadTech IT Solutions Pvt. Ltd.

Gopakumar N G
On 3/5/14, 1:14 AM
0
Zicklee
On 3/5/14, 1:22 AM

This normally happens when you have a one2many or other types of links to relations in a module that you want to uninstall. Fist check that the module that you want to uninstall has any relation with other modules?. Remove the dependencies so that each module can be independently installed and uninstalled.

0
Daryl van Sittert
On 10/2/14, 4:12 AM

I completely messed up my custom module and had to uninstall it manually.

I had to get the ID of each model that I created in my custom module:

"select * from ir_model where model like '%my_model_name%';"

And then delete the contrainsts, relations and models from the DB by replacing <ID> with your particular ID from above.

"delete from ir_model_constraint where model = <ID>;
delete from ir_model_relation where model = <ID>;
delete from ir_model where id = <ID>;"

After this, the uninstall worked.  I wouldn't do this on a live system.  I have no idea about the long term consequences but it seems to be working fine on my dev platform.

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

0 follower(s)

Stats

Asked: 3/4/14, 9:17 AM
Seen: 3129 times
Last updated: 3/16/15, 8:10 AM