[IMP] calendar: add link to join video call

This commit adds a link to each calendar.event to join a video call
hosted on Jitsi.

The domain of the Jitsi instance can be configured using the
configuration parameter `website_jitsi.jitsi_server_domain` (defaults to
meet.jit.si).

TaskID: 2367543
This commit is contained in:
Kevin Baptiste
2020-12-09 10:16:44 +01:00
parent e562a22ad2
commit 61e9b6ac4e
5 changed files with 37 additions and 0 deletions
@@ -77,6 +77,9 @@
</li>
% endfor
</ul></li>
% if object.event_id.videocall_location:
<li>Join Video Call: <a href="${object.event_id.videocall_location}" target="_blank">${object.event_id.videocall_location}</a></li>
% endif
</ul>
</td>
</tr></table>
@@ -168,6 +171,9 @@
</li>
% endfor
</ul></li>
% if object.event_id.videocall_location:
<li>Join Video Call: <a href="${object.event_id.videocall_location}" target="_blank">${object.event_id.videocall_location}</a></li>
% endif
</ul>
</td>
</tr></table>
@@ -257,6 +263,9 @@
</li>
% endfor
</ul></li>
% if object.event_id.videocall_location:
<li>Join Video Call: <a href="${object.event_id.videocall_location}" target="_blank">${object.event_id.videocall_location}</a></li>
% endif
</ul>
</td>
</tr></table>
+12
View File
@@ -3,9 +3,11 @@
from datetime import timedelta
import math
from uuid import uuid4
import babel.dates
import logging
import pytz
from werkzeug.urls import url_join
from odoo import api, fields, models
from odoo import tools
@@ -78,6 +80,15 @@ class Meeting(models.Model):
partners |= self.env['res.partner'].browse(active_id)
return partners
@api.model
def _default_videocall_location(self):
if self.env.context.get('calendar_no_videocall'):
return False
jitsi_url = self.env['ir.config_parameter'].sudo().get_param('website_jitsi.jitsi_server_domain', 'meet.jit.si')
if not jitsi_url.startswith('http'):
jitsi_url = 'https://' + jitsi_url
return url_join(jitsi_url, 'odoo-%s' % (uuid4().hex[:12]))
def _find_my_attendee(self):
""" Return the first attendee where the user connected has been invited
from all the meeting_ids in parameters.
@@ -211,6 +222,7 @@ class Meeting(models.Model):
('confidential', 'Only internal users')],
'Privacy', default='public', required=True)
location = fields.Char('Location', tracking=True, help="Location of Event")
videocall_location = fields.Char('Join Video Call', default=_default_videocall_location)
show_as = fields.Selection(
[('free', 'Available'),
('busy', 'Busy')], 'Show Time as', default='busy', required=True)
@@ -68,3 +68,12 @@
font-weight: bold;
}
}
.o_cw_body .o_field_copy {
max-width: calc(100% - 6rem);
width: unset !important;
}
.o_cw_body .o_clipboard_button {
padding-top: 0px !important;
}
+6
View File
@@ -112,6 +112,11 @@
class="oe_inline"/>
</h2>
</div>
<group>
<group>
<field name="videocall_location" string="Join Video Call" widget="CopyClipboardURL" attrs="{'invisible': [('videocall_location', '=', False)]}" />
</group>
</group>
<notebook>
<page name="page_details" string="Meeting Details">
<group>
@@ -255,6 +260,7 @@
event_open_popup="true"
event_limit="5"
color="user_id">
<field name="videocall_location" string="Join Video Call" widget="CopyClipboardURL" />
<field name="attendee_status"/>
<field name="user_id" string="Responsible" filters="1" widget="many2one_avatar_user"/>
<field name="partner_ids" widget="many2manyattendee" write_model="calendar.contacts" write_field="partner_id" avatar_field="image_128"/>
+1
View File
@@ -869,6 +869,7 @@ class HolidaysRequest(models.Model):
meeting_values = meeting_holidays._prepare_holidays_meeting_values()
meetings = self.env['calendar.event'].with_context(
no_mail_to_attendees=True,
calendar_no_videocall=True,
active_model=self._name
).create(meeting_values)
for holiday, meeting in zip(meeting_holidays, meetings):