-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
from odoo import api, fields, models | ||
import pytz | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class Calendar(models.Model): | ||
_inherit = "calendar.event" | ||
|
||
videocall_location = fields.Char(compute="_meeting_url") | ||
videocall_location = fields.Char(compute="_compute_meeting_url") | ||
|
||
@api.depends("start") | ||
def _meeting_url(self): | ||
def _compute_meeting_url(self): | ||
for rec in self: | ||
rec.date_combination = rec.start.astimezone( | ||
tz=pytz.timezone('Asia/Yekaterinburg') | ||
tz=pytz.timezone("Asia/Yekaterinburg") | ||
).strftime( | ||
'%Y%m%d' | ||
"%Y%m%d" | ||
) # timezone(self.env.user.tz or 'Asia/Yekaterinburg'). | ||
# list of timezones https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568 | ||
# list of timezones: | ||
# https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568 | ||
rec.videocall_location = ( | ||
"https://meet.jit.si/discussion_%s" % rec.date_combination | ||
) |