This question has been flagged
8 Replies
32393 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'

Avatar
Discard
Best Answer

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. 

Avatar
Discard
Best Answer

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'

Avatar
Discard
Author Best Answer

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

Avatar
Discard
Best Answer

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.

Avatar
Discard
Best Answer

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

Avatar
Discard

The link to the script you recomend is dead

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

Best Answer
Avatar
Discard
Best Answer

set uninstall to you module. then reinstall will be ok 

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

Avatar
Discard