This question has been flagged
2 Replies
4710 Views

I create a module and when I uninstall it, I have the following error message.

How can I uninstall it without this error message?

Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/http.py", line 470, in dispatch result = self._call_function(**self.params) File "/usr/lib/pymodules/python2.7/openerp/http.py", line 294, in _call_function return checked_call(self.db, *args, **kwargs) File "/usr/lib/pymodules/python2.7/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/usr/lib/pymodules/python2.7/openerp/http.py", line 291, in checked_call return self.endpoint(*a, **kw) File "/usr/lib/pymodules/python2.7/openerp/http.py", line 638, in __call__ return self.method(*args, **kw) File "/usr/lib/pymodules/python2.7/openerp/http.py", line 337, in response_wrap response = f(*args, **kw) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1246, in call_button action = self._call_kw(model, method, args, {}) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1234, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/base/module/module.py", line 499, in button_immediate_uninstall return self._button_immediate_function(cr, uid, ids, self.button_uninstall, context=context) File "/usr/lib/pymodules/python2.7/openerp/addons/base/module/module.py", line 479, in _button_immediate_function registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True) File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 299, in new openerp.modules.load_modules(registry._db, force_demo, status, update_module) File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 403, in load_modules registry['ir.module.module'].module_uninstall(cr, SUPERUSER_ID, mod_ids_to_remove) File "/usr/lib/pymodules/python2.7/openerp/addons/base/module/module.py", line 443, in module_uninstall ir_model_constraint._module_data_uninstall(cr, uid, constraint_ids, context) File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_model.py", line 521, in _module_data_uninstall model_obj = self.pool[model] File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 106, in __getitem__ return self.models[model_name] KeyError: u'formateur'

Thanks

Avatar
Discard
Best Answer
Hi ,

Its because you created a table named 'formateur' and then removed that table. And after that trying to uninstall that module. In order to uninstall that module you need to rewrite that class (table) simply and no need to define fileds to that table. For eg:


class Formateur(models.Model):
_name = 'formateur'

Avatar
Discard
Best Answer

hi Dede,

check if the field "formateur" is present in your database

Avatar
Discard