Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

14.0: Errors on uninstalling tracking_manager #2895

Open
damdam-s opened this issue Apr 1, 2024 · 1 comment
Open

14.0: Errors on uninstalling tracking_manager #2895

damdam-s opened this issue Apr 1, 2024 · 1 comment
Labels

Comments

@damdam-s
Copy link
Member

damdam-s commented Apr 1, 2024

Module

tracking_manager

Describe the bug

When uninstalling tracking_manager module, errors are present in the log.
If uninstall process is done in a script, the script fails.

To Reproduce

Affected versions: 14.0

Steps to reproduce the behavior:

  1. uninstall tracking_manager from the UI (or via migration script or whatever)
  2. error below appears on the logs
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/cache.py", line 85, in lookup
    r = d[key]
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/func.py", line 71, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
KeyError: ('ir.model.data', <function Base.is_tracked_by_o2m at 0x111fe4ee0>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/cache.py", line 85, in lookup
    r = d[key]
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/func.py", line 71, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
KeyError: ('ir.model', <function IrModel._get_model_tracked_by_o2m at 0x111fe45e0>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/base/models/ir_model.py", line 2182, in delete
    records.unlink()
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/base/models/ir_model.py", line 870, in unlink
    res = super(IrModelFields, self).unlink()
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/tracking_manager/models/models.py", line 155, in unlink
    return super().unlink()
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/component_event/models/base.py", line 118, in unlink
    result = super(Base, self).unlink()
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/models.py", line 3499, in unlink
    ir_model_data_unlink.unlink()
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/base/models/ir_model.py", line 2009, in unlink
    return super(IrModelData, self).unlink()
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/tracking_manager/models/models.py", line 153, in unlink
    if self.is_tracked_by_o2m():
  File "<decorator-gen-184>", line 2, in is_tracked_by_o2m
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/cache.py", line 90, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/tracking_manager/models/models.py", line 21, in is_tracked_by_o2m
    return self._name in self.env["ir.model"]._get_model_tracked_by_o2m()
  File "<decorator-gen-183>", line 2, in _get_model_tracked_by_o2m
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/cache.py", line 90, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/addons/tracking_manager/models/ir_model.py", line 54, in _get_model_tracked_by_o2m
    fields = self.env["ir.model.fields"].search(
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/models.py", line 1713, in search
    return res if count else self.browse(res)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/models.py", line 5004, in browse
    if not ids:
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/osv/query.py", line 172, in __bool__
    return bool(self._result)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/tools/func.py", line 26, in __get__
    value = self.fget(obj)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/osv/query.py", line 165, in _result
    self._cr.execute(query_str, params)
  File "<decorator-gen-5>", line 2, in execute
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/sql_db.py", line 101, in check
    return f(self, *args, **kwargs)
  File "/Users/damien/work/.../.direnv/python-3.8/lib/python3.8/site-packages/odoo/sql_db.py", line 301, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column ir_model.active_custom_tracking does not exist
LINE 1: ..." in (SELECT "ir_model".id FROM "ir_model" WHERE ("ir_model"...
  1. if uninstallation is launched by a script, the script fails
  2. if uninstallation is launched by a user action in UI, uninstallation is OK but errors are present in the logs

Expected behavior

Module uninstalls properly without errors

@damdam-s damdam-s added the bug label Apr 1, 2024
@damdam-s
Copy link
Member Author

damdam-s commented Apr 2, 2024

FYI @Kev-Roche

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant