Skip to Content

Contributors

datetime error when accessing parts of Odoo

Hello Contributors,

I am running Odoo v10 and I have an odd error that has just started popping up and it only seems to appear in the Discuss, Sales, and Project Tasks:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 642, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 334, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 327, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 942, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 507, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/addons/calendar/controllers/main.py", line 65, in notify
    return request.env['calendar.alarm_manager'].get_next_notif()
  File "/usr/lib/python2.7/dist-packages/odoo/addons/calendar/models/calendar.py", line 380, in get_next_notif
    for one_date in meeting._get_recurrent_date_by_event():
  File "/usr/lib/python2.7/dist-packages/odoo/addons/calendar/models/calendar.py", line 570, in _get_recurrent_date_by_event
    return [d.astimezone(pytz.UTC) if d.tzinfo else d for d in rset1]
  File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1144, in _iter
    self._genitem(rlist, gen)
  File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1082, in __init__
    self.dt = advance_iterator(gen)
  File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 652, in _iter
    if until and res > until:
TypeError: can't compare offset-naive and offset-aware datetimes

Other users on the system do not get this error at all. The only thing I can think of that I did recently was to remove a recurring event from my google calendar that is no longer relevant.
Short of creating a new user I have not figured out a good solution and I was hoping someone here might be able to shine a light on what is causing the error.

Thank you,


-- 
Nathan Kennedy
Jack of all trades
Master of none
Just don't call me Jack

by nathan - 08:01 - 4 Jan 2020

Follow-Ups

  • Re: datetime error when accessing parts of Odoo
    On Sat, 2020-01-04 at 23:06 +0000, Iván Todorovich wrote:
    Check if the user has a timezone configured in his preferences.

    I remember encountering something like this a while back
    Hello Ivan,

    Thank you for the response but that is the first thing I checked in case it had gotten cleared somehow. Just for the heck of it I changed the timezone and changed it back but that had no effect.

    Cheers,

    -- 
    Nathan Kennedy
    Contracted Professional IT
    (360) 637-1090
    https://www.nkent.us/

    by Nathan Kennedy - 12:51 - 5 Jan 2020
  • Re: datetime error when accessing parts of Odoo
    Hi Nathan!

    Check if the user has a timezone configured in his preferences.

    I remember encountering something like this a while back

    Le sam. 4 janv. 2020 à 16:02, Nathan Kennedy <nathan@wakennedys.us> a écrit :
    Hello Contributors,

    I am running Odoo v10 and I have an odd error that has just started popping up and it only seems to appear in the Discuss, Sales, and Project Tasks:

    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 642, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 684, in dispatch
        result = self._call_function(**self.params)
      File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 334, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper
        return f(dbname, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 327, in checked_call
        result = self.endpoint(*a, **kw)
      File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 942, in __call__
        return self.method(*args, **kw)
      File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 507, in response_wrap
        response = f(*args, **kw)
      File "/usr/lib/python2.7/dist-packages/odoo/addons/calendar/controllers/main.py", line 65, in notify
        return request.env['calendar.alarm_manager'].get_next_notif()
      File "/usr/lib/python2.7/dist-packages/odoo/addons/calendar/models/calendar.py", line 380, in get_next_notif
        for one_date in meeting._get_recurrent_date_by_event():
      File "/usr/lib/python2.7/dist-packages/odoo/addons/calendar/models/calendar.py", line 570, in _get_recurrent_date_by_event
        return [d.astimezone(pytz.UTC) if d.tzinfo else d for d in rset1]
      File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1144, in _iter
        self._genitem(rlist, gen)
      File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1082, in __init__
        self.dt = advance_iterator(gen)
      File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 652, in _iter
        if until and res > until:
    TypeError: can't compare offset-naive and offset-aware datetimes

    Other users on the system do not get this error at all. The only thing I can think of that I did recently was to remove a recurring event from my google calendar that is no longer relevant.
    Short of creating a new user I have not figured out a good solution and I was hoping someone here might be able to shine a light on what is causing the error.

    Thank you,


    -- 
    Nathan Kennedy
    Jack of all trades
    Master of none
    Just don't call me Jack

    _______________________________________________
    Mailing-List: https://odoo-community.org/groups/contributors-15
    Post to: mailto:contributors@odoo-community.org
    Unsubscribe: https://odoo-community.org/groups?unsubscribe


    by Iván Todorovich - 12:06 - 5 Jan 2020