Skip to content

Commit 550ad53

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#84054 Signed-off-by: Arnaud Joset <arj@odoo.com>
1 parent b3c46e8 commit 550ad53

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
@@ -99,7 +99,7 @@ def _microsoft_to_odoo_values(self, microsoft_event, default_reminders=(), defau
9999
values = {
100100
**default_values,
101101
'name': microsoft_event.subject or _("(No title)"),
102-
'description': microsoft_event.bodyPreview,
102+
'description': microsoft_event.body['content'],
103103
'location': microsoft_event.location and microsoft_event.location.get('displayName') or False,
104104
'user_id': microsoft_event.owner(self.env).id,
105105
'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
@@ -33,7 +33,7 @@ def __init__(self, microsoft_service):
3333
@requires_auth_token
3434
def get_events(self, sync_token=None, token=None, timeout=TIMEOUT):
3535
url = "/v1.0/me/calendarView/delta"
36-
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer %s' % token, 'Prefer': 'odata.maxpagesize=50'}
36+
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer %s' % token, 'Prefer': 'odata.maxpagesize=50,outlook.body-content-type="text"'}
3737
params = {}
3838
if sync_token:
3939
params['$deltatoken'] = sync_token

0 commit comments

Comments
 (0)