Skip to content

Commit

Permalink
🚑 pre-commit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmir-k committed Jan 17, 2024
1 parent 1d020a4 commit 210314e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions itpp_calendar_meeting_url/models/calendar.py
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
)

0 comments on commit 210314e

Please sign in to comment.