Skip to Content
Menu
This question has been flagged
2 Replies
6800 Views

Hello,

When I uninstall a Odoo module, I have in console pycharm this error but my module is uninstall : 

2018-12-21 13:15:24,940 5292 INFO odoo odoo.addons.base.ir.ir_model: Deleting 7745@ir.model.fields
2018-12-21 13:15:24,941 5292 INFO odoo odoo.addons.base.ir.ir_model: Unable to delete 7745@ir.model.fields
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 1335, in unlink_if_refcount
    self.env[model].browse(res_id).unlink()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 509, in unlink
    self._drop_column()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 429, in _drop_column
    model = self.env[field.model]
  File "/var/lib/odoo/odoo/odoo/odoo/api.py", line 760, in __getitem__
    return self.registry[model_name]._browse((), self)
  File "/var/lib/odoo/odoo/odoo/odoo/modules/registry.py", line 178, in __getitem__
    return self.models[model_name]
KeyError: u'test.test'
2018-12-21 13:15:24,942 5292 INFO odoo odoo.addons.base.ir.ir_model: Deleting 7744@ir.model.fields
2018-12-21 13:15:24,943 5292 INFO odoo odoo.addons.base.ir.ir_model: Unable to delete 7744@ir.model.fields
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 1335, in unlink_if_refcount
    self.env[model].browse(res_id).unlink()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 509, in unlink
    self._drop_column()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 429, in _drop_column
    model = self.env[field.model]
  File "/var/lib/odoo/odoo/odoo/odoo/api.py", line 760, in __getitem__
    return self.registry[model_name]._browse((), self)
  File "/var/lib/odoo/odoo/odoo/odoo/modules/registry.py", line 178, in __getitem__
    return self.models[model_name]
KeyError: u'test.test'
2018-12-21 13:15:24,944 5292 INFO odoo odoo.addons.base.ir.ir_model: Deleting 7742@ir.model.fields
2018-12-21 13:15:24,945 5292 INFO odoo odoo.addons.base.ir.ir_model: Unable to delete 7742@ir.model.fields
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 1335, in unlink_if_refcount
    self.env[model].browse(res_id).unlink()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 509, in unlink
    self._drop_column()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 429, in _drop_column
    model = self.env[field.model]
  File "/var/lib/odoo/odoo/odoo/odoo/api.py", line 760, in __getitem__
    return self.registry[model_name]._browse((), self)
  File "/var/lib/odoo/odoo/odoo/odoo/modules/registry.py", line 178, in __getitem__
    return self.models[model_name]
KeyError: u'test.test'
2018-12-21 13:15:24,946 5292 INFO odoo odoo.addons.base.ir.ir_model: Deleting 7739@ir.model.fields
2018-12-21 13:15:24,947 5292 INFO odoo odoo.addons.base.ir.ir_model: Unable to delete 7739@ir.model.fields
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 1335, in unlink_if_refcount
    self.env[model].browse(res_id).unlink()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 509, in unlink
    self._drop_column()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/base/ir/ir_model.py", line 429, in _drop_column
    model = self.env[field.model]
  File "/var/lib/odoo/odoo/odoo/odoo/api.py", line 760, in __getitem__
    return self.registry[model_name]._browse((), self)
  File "/var/lib/odoo/odoo/odoo/odoo/modules/registry.py", line 178, in __getitem__
    return self.models[model_name]
KeyError: u'test.test'

How make ? 

Thanks you !

Avatar
Discard
Best Answer

Hi,

Turn back to your first installation version of  addon. Rollback your code editings. After then try again to uninstall.

Avatar
Discard
Author Best Answer

Hi,

Thanks you it works. 

I had to to re-create class with same model, uninstall module and install module and it works :) 

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 19
7002
3
Jul 23
15040
1
Nov 19
3376
1
Mar 16
3491
1
Mar 15
6880