Skip to content

Commit

Permalink
[15.0][ADD] resource_boooking: Add meeting url in resource booking
Browse files Browse the repository at this point in the history
TT45337
  • Loading branch information
carolinafernandez-tecnativa committed Oct 26, 2023
1 parent bae0c41 commit a4548a1
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 62 deletions.
99 changes: 45 additions & 54 deletions resource_booking/i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * resource_booking
# * resource_booking
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-30 10:28+0000\n"
"PO-Revision-Date: 2021-04-30 11:29+0100\n"
"Last-Translator: Jairo Llopis <[email protected]>\n"
"POT-Creation-Date: 2023-10-20 15:55+0000\n"
"PO-Revision-Date: 2023-10-20 15:55+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: resource_booking
#: code:addons/resource_booking/models/resource_booking.py:0
Expand Down Expand Up @@ -142,6 +140,11 @@ msgstr ""
msgid "<strong>Location:</strong>"
msgstr "<strong>Ubicación:</strong>"

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_portal_form
msgid "<strong>Meeting URL:</strong>"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_portal_form
msgid "<strong>Requested by:</strong>"
Expand Down Expand Up @@ -303,7 +306,7 @@ msgstr "Reservas/citas disponibles para este tipo"
#. module: resource_booking
#: model:ir.model,name:resource_booking.model_calendar_event
msgid "Calendar Event"
msgstr ""
msgstr "Evento de calendario"

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
Expand All @@ -324,31 +327,27 @@ msgid ""
"\n"
"- %s"
msgstr ""
"No se pueden agendar estas reservas/citas porque no se les han seleccionado "
"recursos:\n"
"No se pueden agendar estas reservas/citas porque no se les han seleccionado recursos:\n"
"\n"
"- %s"

#. module: resource_booking
#: code:addons/resource_booking/models/resource_booking.py:0
#, python-format
msgid ""
"Cannot schedule these bookings because they do not fit in their type or "
"resources calendars, or because all resources are busy:\n"
"Cannot schedule these bookings because they do not fit in their type or resources calendars, or because all resources are busy:\n"
"\n"
"- %s"
msgstr ""
"No se pueden agendar estas reservas/citas porque no encajan en los "
"calendarios de sus tipos o recursos, o porque todos sus recursos están "
"ocupados:\n"
"No se pueden agendar estas reservas/citas porque no encajan en los calendarios de sus tipos o recursos, o porque todos sus recursos están ocupados:\n"
"\n"
"- %s"

#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_resource_booking_type__combination_assignment
msgid ""
"Choose how to auto-assign resource combinations. It has no effect if assiged "
"manually."
"Choose how to auto-assign resource combinations. It has no effect if assiged"
" manually."
msgstr ""
"Escoja cómo autoasignar combinaciones de recursos. No tendrá efecto si se "
"asigna manualmente."
Expand Down Expand Up @@ -584,9 +583,7 @@ msgstr "Si está marcado, hay nuevos mensajes que requieren de su atención."

#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_resource_booking__message_has_error
#: model:ir.model.fields,help:resource_booking.field_resource_booking__message_has_sms_error
#: model:ir.model.fields,help:resource_booking.field_resource_booking_type__message_has_error
#: model:ir.model.fields,help:resource_booking.field_resource_booking_type__message_has_sms_error
msgid "If checked, some messages have a delivery error."
msgstr "Si está marcado, algunos mensajes no se pudieron entregar."

Expand Down Expand Up @@ -695,6 +692,12 @@ msgstr ""
msgid "Meeting"
msgstr "Reunión"

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__videocall_location
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__videocall_location
msgid "Meeting URL"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_resource_booking__meeting_id
msgid "Meeting confirmed for this booking."
Expand Down Expand Up @@ -835,8 +838,8 @@ msgstr "Solo puede existir un evento por reserva de recursos."
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
msgid "Open a calendar to schedule a meeting for this booking request."
msgstr ""
"Abrir un calendario para agendar una reunión para esta solicitud de reserva/"
"cita."
"Abrir un calendario para agendar una reunión para esta solicitud de "
"reserva/cita."

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__user_id
Expand All @@ -859,8 +862,7 @@ msgid ""
msgstr ""
"Pendiente: No se ha agendado ninguna reunión.\n"
"Agendada: El solicitante todavía no ha confirmado su asistencia.\n"
"Confirmada: La reunión ha sido agendada, y el solicitante ha confirmado su "
"asistencia.\n"
"Confirmada: La reunión ha sido agendada, y el solicitante ha confirmado su asistencia.\n"
"Cancelada: La reunión se ha borrado y la reserva/cita se ha archivado."

#. module: resource_booking
Expand Down Expand Up @@ -923,7 +925,7 @@ msgstr ""
#. module: resource_booking
#: model:ir.model,name:resource_booking.model_resource_calendar
msgid "Resource Working Time"
msgstr "Horario de trabajo del recurso"
msgstr "Tiempo de Trabajo de Recursos"

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_calendar_event__resource_booking_ids
Expand Down Expand Up @@ -986,12 +988,6 @@ msgstr "Usuario responsable"
msgid "Restrict bookings to this schedule."
msgstr "Restringir reservas/citas a este horario."

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_has_sms_error
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_has_sms_error
msgid "SMS Delivery error"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.portal_breadcrumbs
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
Expand Down Expand Up @@ -1100,11 +1096,11 @@ msgstr "Etiquetas"
#: model:ir.model.fields,help:resource_booking.field_resource_booking__requester_advice
#: model:ir.model.fields,help:resource_booking.field_resource_booking_type__requester_advice
msgid ""
"Text that will appear by default in portal invitation emails and in calendar "
"views for scheduling."
"Text that will appear by default in portal invitation emails and in calendar"
" views for scheduling."
msgstr ""
"Texto que aparecerá por defecto en los correos electrónicos de invitación al "
"portal y en las vistas de calendario para agendar."
"Texto que aparecerá por defecto en los correos electrónicos de invitación al"
" portal y en las vistas de calendario para agendar."

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.portal_my_bookings
Expand All @@ -1115,8 +1111,8 @@ msgstr "Actualmente no hay reservas/citas en su cuenta."
#: model_terms:ir.actions.act_window,help:resource_booking.resource_booking_type_action
msgid ""
"These records categorize resource bookings and apply restrictions to them, "
"such as available resource combinations, availability schedules and interval "
"duration."
"such as available resource combinations, availability schedules and interval"
" duration."
msgstr ""
"Estos registros categorizan las reservas/citas de recursos y les aplican "
"restricciones, como combinaciones de recursos disponibles, horarios de "
Expand Down Expand Up @@ -1238,8 +1234,8 @@ msgstr "Historial de comunicaciones del sitio web"
#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_resource_booking__combination_auto_assign
msgid ""
"When checked, resource combinations will be (un)assigned automatically based "
"on their availability during the booking dates."
"When checked, resource combinations will be (un)assigned automatically based"
" on their availability during the booking dates."
msgstr ""

#. module: resource_booking
Expand All @@ -1249,18 +1245,18 @@ msgid ""
"requester didn't place the booking yet."
msgstr ""
"Cuando esté agendada, los recursos estarán bloqueados. Cuando esté "
"pendiente, significa que el solicitante todavía no ha agendado su reserva/"
"cita."
"pendiente, significa que el solicitante todavía no ha agendado su "
"reserva/cita."

#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_resource_booking_type__modifications_deadline
msgid ""
"When this deadline has been exceeded, if a booking was not yet confirmed, it "
"will be canceled automatically. Also, only booking managers will be able to "
"unschedule or reschedule them. The value is expressed in hours."
"When this deadline has been exceeded, if a booking was not yet confirmed, it"
" will be canceled automatically. Also, only booking managers will be able to"
" unschedule or reschedule them. The value is expressed in hours."
msgstr ""
"Cuando esta fecha límite se haya sobrepasado, si una reserva/cita todavía no "
"se había confirmado, será cancelada automáticamente. También, solo los "
"Cuando esta fecha límite se haya sobrepasado, si una reserva/cita todavía no"
" se había confirmado, será cancelada automáticamente. También, solo los "
"responsables de reservas/citas podrán desagendarla o reagendarla. El valor "
"se expresa en horas."

Expand Down Expand Up @@ -1291,20 +1287,15 @@ msgstr "Está a punto de confirmar esta reserva/cita:"
#: code:addons/resource_booking/models/calendar_event.py:0
#, python-format
msgid ""
"You are not allowed to alter these bookings because they exceeded their "
"modification deadlines:\n"
"You are not allowed to alter these bookings because they exceeded their modification deadlines:\n"
"\n"
"- %s"
msgstr ""
"No puede alterar estas reservas/citas porque han sobrepasado su fecha límite "
"de modificaciones:\n"
"No puede alterar estas reservas/citas porque han sobrepasado su fecha límite de modificaciones:\n"
"\n"
"- %s"

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.message_combination_assigned
msgid "because you belong to the chosen resource combination:"
msgstr ""

#~ msgid "Followers (Channels)"
#~ msgstr "Seguidores (canales)"
21 changes: 13 additions & 8 deletions resource_booking/i18n/resource_booking.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-20 15:09+0000\n"
"PO-Revision-Date: 2023-10-20 15:09+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -126,6 +128,11 @@ msgstr ""
msgid "<strong>Location:</strong>"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_portal_form
msgid "<strong>Meeting URL:</strong>"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_portal_form
msgid "<strong>Requested by:</strong>"
Expand Down Expand Up @@ -554,9 +561,7 @@ msgstr ""

#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_resource_booking__message_has_error
#: model:ir.model.fields,help:resource_booking.field_resource_booking__message_has_sms_error
#: model:ir.model.fields,help:resource_booking.field_resource_booking_type__message_has_error
#: model:ir.model.fields,help:resource_booking.field_resource_booking_type__message_has_sms_error
msgid "If checked, some messages have a delivery error."
msgstr ""

Expand Down Expand Up @@ -665,6 +670,12 @@ msgstr ""
msgid "Meeting"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__videocall_location
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__videocall_location
msgid "Meeting URL"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_resource_booking__meeting_id
msgid "Meeting confirmed for this booking."
Expand Down Expand Up @@ -948,12 +959,6 @@ msgstr ""
msgid "Restrict bookings to this schedule."
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_has_sms_error
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_has_sms_error
msgid "SMS Delivery error"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.portal_breadcrumbs
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
Expand Down
22 changes: 22 additions & 0 deletions resource_booking/models/resource_booking.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2021 Tecnativa - Jairo Llopis
# Copyright 2022 Tecnativa - Pedro M. Baeza
# Copyright 2023 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import calendar
Expand Down Expand Up @@ -151,6 +152,12 @@ class ResourceBooking(models.Model):
readonly=False,
store=True,
)
videocall_location = fields.Char(
compute="_compute_videocall_location",
string="Meeting URL",
readonly=False,
store=True,
)
requester_advice = fields.Text(related="type_id.requester_advice", readonly=True)
is_modifiable = fields.Boolean(compute="_compute_is_modifiable")
is_overdue = fields.Boolean(compute="_compute_is_overdue")
Expand Down Expand Up @@ -271,6 +278,20 @@ def _compute_location(self):
elif record.meeting_id:
record.location = record.meeting_id.location

@api.depends("meeting_id.videocall_location", "type_id")
def _compute_videocall_location(self):
"""Get videocall location from meeting or type."""
for record in self:
# Get videocall_location from type when changing it or creating from ORM
if (
not record.videocall_location
or record._origin.type_id != record.type_id
):
record.videocall_location = record.type_id.videocall_location
# Get it from meeting only when available
elif record.meeting_id:
record.videocall_location = record.meeting_id.videocall_location

@api.depends("active", "meeting_id.attendee_ids.state")
def _compute_state(self):
"""Obtain request state."""
Expand Down Expand Up @@ -340,6 +361,7 @@ def _prepare_meeting_vals(self):
description=self.type_id.requester_advice,
duration=self.duration,
location=self.location,
videocall_location=self.videocall_location,
name=self.name or self._get_name_formatted(self.partner_id, self.type_id),
partner_ids=[
(4, partner.id, 0) for partner in self.partner_id | resource_partners
Expand Down
1 change: 1 addition & 0 deletions resource_booking/models/resource_booking_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ResourceBookingType(models.Model):
),
)
location = fields.Char()
videocall_location = fields.Char(string="Meeting URL")
modifications_deadline = fields.Float(
required=True,
default=24,
Expand Down
9 changes: 9 additions & 0 deletions resource_booking/templates/portal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,15 @@
<strong>Location:</strong>
<span t-field="booking_sudo.location" />
</div>
<div class="mb-1">
<strong>Meeting URL:</strong>
<a
t-att-href="booking_sudo.videocall_location"
target="_blank"
>
<t t-out="booking_sudo.videocall_location or ''" />
</a>
</div>
<div class="mb-1">
<strong>Dates:</strong>
<span t-field="booking_sudo.meeting_id.display_time" />
Expand Down
1 change: 1 addition & 0 deletions resource_booking/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def create_test_data(obj):
],
"resource_calendar_id": obj.r_calendars[2].id,
"location": "Main office",
"videocall_location": "Videocall Main office",
}
)
# Create some partner
Expand Down
Loading

0 comments on commit a4548a1

Please sign in to comment.