This question has been flagged

Hello everybody,


I've set up the native configuration of Odoo14 about Microsoft365 calendar sync.

It works... with my account. With my colleague's account, it works in one way only.


I explain:

When I create an event in the outlook client. I dont see it in Odoo.

When I create an event in Odoo. I see it in the outlook client. AND I have an error exception on Odoo side.


Thanks for your help.


The error details:

Odoo Server Error

 

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch

    result = request.dispatch()

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 683, in dispatch

    result = self._call_function(**self.params)

 File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper

    return f(dbname, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 347, in checked_call

    result = self.endpoint(*a, **kw)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 912, in __call__

    return self.method(*args, **kw)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 531, in response_wrap

    response = f(*args, **kw)

  File "/usr/lib/python3/dist-packages/odoo/addons/microsoft_calendar/controllers/main.py", line 44, in sync_data

    need_refresh = request.env.user.sudo()._sync_microsoft_calendar(MicrosoftCal)

  File "/usr/lib/python3/dist-packages/odoo/addons/microsoft_calendar/models/res_users.py", line 81, in _sync_microsoft_calendar

    synced_events, synced_recurrences = self.env['calendar.event']._sync_microsoft2odoo(events, default_reminders=default_reminders) if events else (self.env['calendar.event'], self.env['calendar.recurrence'])

  File "/usr/lib/python3/dist-packages/odoo/addons/microsoft_calendar/models/microsoft_sync.py", line 254, in _sync_microsoft2odoo

    odoo_values = [

  File "/usr/lib/python3/dist-packages/odoo/addons/microsoft_calendar/models/microsoft_sync.py", line 255, in <listcomp>

    dict(self._microsoft_to_odoo_values(e, default_reminders, default_values), need_sync_m=False)

  File "/usr/lib/python3/dist-packages/odoo/addons/microsoft_calendar/models/calendar.py", line 73, in _microsoft_to_odoo_values

    commands_attendee, commands_partner = self._odoo_attendee_commands_m(microsoft_event)

  File "/usr/lib/python3/dist-packages/odoo/addons/microsoft_calendar/models/calendar.py", line 150, in _odoo_attendee_commands_m

    partner = self.env['res.partner'].find_or_create(email)

  File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/res_partner.py", line 53, in find_or_create

    raise ValueError(_('An email is required for find_or_create to work'))

Exception

 

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

 

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception

    raise exception.with_traceback(None) from new_cause

ValueError: An email is required for find_or_create to work

Avatar
Discard

Your error message is self-explanatory. Please check the setup of your email address.

It is not self-explanatory:

1) i have email for user

2) i have email for related partner of user

3) i have email for employee of related user

i still get the same error.

Best Answer

Same Issue here. Using Odoo14 on a ubuntu server.

For some users the 2 way sync is working:

Odoo to 365 calendar is almost instant (5 seconds and it shows up in 365 user calendar)
365 to Odoo updates only once every hower that the token refreshes.

I setup an new enviroment, but the same issue comes back:
File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/res_partner.py", line 54, in find_or_create
raise ValueError(_('An email is required for find_or_create to work'))
Exception

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

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
ValueError: An email is required for find_or_create to work

The error pops up for the user that hat the issue before. Other users working again with 2way sync.

Avatar
Discard