Skip to content

Commit c2b545f

Browse files
committed
[FIX] microsoft_calendar: fetch full description
Step to reproduce: - Create a event in outlook with a long description - Load the event in Odoo Current Behaviour: - Odoo use the body preview to get the event description If the body is longer then, the description in Odoo is incomplete. Behaviour after PR: - Change fetch option to get description as text - Use body['content'] as description which is the full body. opw-2746358 closes odoo#84262 X-original-commit: 550ad53 Signed-off-by: Arnaud Joset <arj@odoo.com>
1 parent 48ce4f0 commit c2b545f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

addons/microsoft_calendar/models/calendar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _microsoft_to_odoo_values(self, microsoft_event, default_reminders=(), defau
105105
values = {
106106
**default_values,
107107
'name': microsoft_event.subject or _("(No title)"),
108-
'description': plaintext2html(microsoft_event.bodyPreview),
108+
'description': microsoft_event.body['content'],
109109
'location': microsoft_event.location and microsoft_event.location.get('displayName') or False,
110110
'user_id': microsoft_event.owner(self.env).id,
111111
'privacy': sensitivity_o2m.get(microsoft_event.sensitivity, self.default_get(['privacy'])['privacy']),

addons/microsoft_calendar/utils/microsoft_calendar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, microsoft_service):
3131
@requires_auth_token
3232
def get_events(self, sync_token=None, token=None, timeout=TIMEOUT):
3333
url = "/v1.0/me/calendarView/delta"
34-
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer %s' % token}
34+
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer %s' % token, 'Prefer': 'outlook.body-content-type="html"'}
3535
params = {}
3636
if sync_token:
3737
params['$deltatoken'] = sync_token

0 commit comments

Comments
 (0)