Skip to content

Commit 4c3b69a

Browse files
committed
[FIX] microsoft_calendar: Send html description to outlook
Step to reproduce: - Create a with a link in the decription - Edit + Save multiple times Current behaviour : - Since c2b545f we fetch the full description with html tags which are rendered via the - When we resend this message to outlook, the description will be updated via html2plaintext. In the case of URL, they will be added as a footnote and thus duplicated if the url is it's own name Behaviour after thr PR: - We could then also send the description with the html tags to ensure full compatibility between the description - Using html2plaintext update the descrtiption to markdown, with some issues, since html is now supported in the odoo editor, using html on both end will remove the need to use html2plaintext and the descriptions changes stemming from it. opw-2746358 closes odoo#87336 Signed-off-by: Arnaud Joset <arj@odoo.com>
1 parent 27a651f commit 4c3b69a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

addons/microsoft_calendar/models/calendar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from odoo import api, fields, models, _
99
from odoo.exceptions import UserError, ValidationError
10-
from odoo.tools import html2plaintext, is_html_empty, plaintext2html
10+
from odoo.tools import is_html_empty
1111

1212
ATTENDEE_CONVERTER_O2M = {
1313
'needsAction': 'notresponded',
@@ -274,8 +274,8 @@ def _microsoft_values(self, fields_to_sync, initial_values={}):
274274

275275
if 'description' in fields_to_sync:
276276
values['body'] = {
277-
'content': html2plaintext(self.description) if not is_html_empty(self.description) else '',
278-
'contentType': "text",
277+
'content': self.description if not is_html_empty(self.description) else '',
278+
'contentType': "html",
279279
}
280280

281281
if any(x in fields_to_sync for x in ['allday', 'start', 'date_end', 'stop']):

addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_restart_synchronization(self):
8888
'start': {'dateTime': '%s-01-15T08:00:00+00:00' % year, 'timeZone': 'Europe/London'},
8989
'end': {'dateTime': '%s-01-15T18:00:00+00:00' % year, 'timeZone': 'Europe/London'},
9090
'subject': 'Event',
91-
'body': {'content': '', 'contentType': 'text'},
91+
'body': {'content': '', 'contentType': 'html'},
9292
'attendees': [],
9393
'isAllDay': False,
9494
'isOrganizer': True,

0 commit comments

Comments
 (0)