Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Odoo OCB 14.0 - KeyError: 'cancel_count', systray_get_activities related? #1176

Open
whotopia opened this issue May 31, 2023 · 1 comment
Open
Labels

Comments

@whotopia
Copy link

whotopia commented May 31, 2023

Module

Resulting likely from within OCB 14.0 core. Might involve mass_mailing

Describe the bug

Seems to be a problem generated in odoo/addons/mail/models/res_users.py line 153 where systray_get_activities functions concatenates 'cancel' to '_count' . However, I am not able to figure out where this 'cancel' comes from or which model is being acted on. This results in a KeyError as 'cancel_count' doesn't exist for the given model.

Upon login,and when clicking the 'Activities' icon, all users see an error message as follows:

Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo/src/odoo-14.0-OCB/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/home/odoo/src/odoo-14.0-OCB/odoo/http.py", line 696, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/http.py", line 370, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/http.py", line 358, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/http.py", line 919, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/http.py", line 544, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/src/odoo-14.0-OCB/addons/web/controllers/main.py", line 1370, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/src/odoo-14.0-OCB/addons/web/controllers/main.py", line 1362, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/api.py", line 395, in call_kw
    result = _call_kw_model(method, model, args, kwargs)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/api.py", line 368, in _call_kw_model
    result = method(recs, *args, **kwargs)
  File "/home/odoo/src/odoo-14.0-OCB/addons/mass_mailing/models/res_users.py", line 16, in systray_get_activities
    activities = super(Users, self).systray_get_activities()
  File "/home/odoo/src/odoo-14.0-OCB/addons/note/models/res_users.py", line 55, in systray_get_activities
    activities = super(Users, self).systray_get_activities()
  File "/home/odoo/src/odoo-14.0-OCB/addons/contacts/models/res_users.py", line 15, in systray_get_activities
    activities = super(Users, self).systray_get_activities()
  File "/home/odoo/src/odoo-14.0-OCB/addons/calendar/models/res_users.py", line 37, in systray_get_activities
    res = super(Users, self).systray_get_activities()
  File "/home/odoo/src/odoo-14.0-OCB/addons/mail/models/res_users.py", line 154, in systray_get_activities
    user_activities[model_name]["%s_count" % activity.state] += 1
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/odoo/src/odoo-14.0-OCB/odoo/http.py", line 652, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo-14.0-OCB/odoo/http.py", line 317, in _handle_exception
    raise exception.with_traceback(None) from new_cause
KeyError: 'cancel_count'

To Reproduce

I see this error in my 14.0 installation.

Steps to reproduce the behaviour:

  1. In my case this started happening after a recent update to OCB 14.0 core
  2. I have run update all modules on the database and tried to clear out all sessions/caches, but still the same.

Expected behavior
There should be no login error message.

Additional context
Running with Python 3.8.13 (default, Nov 8 2022, 17:19:05)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] on linux

@whotopia whotopia added the bug label May 31, 2023
@whotopia
Copy link
Author

And after some investigation, this error may actually be caused by an interaction with another modules I have installed. Namely: https://github.com/CybroOdoo/CybroAddons/blob/14.0/todo_list

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

No branches or pull requests

1 participant