Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5983 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
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'

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

hi Dede,

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 20
8933
1
thg 11 19
4965
1
thg 3 16
4870
1
thg 3 15
8261
3
thg 2 24
10402