Skip to content

Commit

Permalink
[IMP] resource_booking: New activity type for resource booking
Browse files Browse the repository at this point in the history
TT47152
  • Loading branch information
carolinafernandez-tecnativa authored and victoralmau committed Mar 8, 2024
1 parent b7c3176 commit e73ccfc
Show file tree
Hide file tree
Showing 16 changed files with 385 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resource_booking/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Resource booking
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1b5ee844dde4d92ddebc83454b46b058b45fddf1013e7ee6d17c187c15b74318
!! source digest: sha256:51d1debd13397d74e8c6b190e42afe83c59d2be4ee084d68f3a52a33d65a414a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down
1 change: 1 addition & 0 deletions resource_booking/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import models
from . import controllers
from .hooks import uninstall_hook
7 changes: 5 additions & 2 deletions resource_booking/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright 2021 Tecnativa - Jairo Llopis
# Copyright 2022 Tecnativa - Pedro M. Baeza
# Copyright 2023 Tecnativa - Carolina Fernandez
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Resource booking",
"summary": "Manage appointments and resource booking",
"version": "15.0.1.4.2",
"version": "15.0.1.5.2",
"development_status": "Production/Stable",
"category": "Appointments",
"website": "https://github.com/OCA/calendar",
Expand All @@ -15,6 +15,7 @@
"license": "AGPL-3",
"application": True,
"installable": True,
"uninstall_hook": "uninstall_hook",
"external_dependencies": {
"python": [
# Used implicitly
Expand All @@ -30,10 +31,12 @@
],
"data": [
"data/mail.xml",
"data/mail_data.xml",
"security/resource_booking_security.xml",
"security/ir.model.access.csv",
"templates/portal.xml",
"views/calendar_event_views.xml",
"views/mail_activity_views.xml",
"views/resource_booking_combination_views.xml",
"views/resource_booking_type_views.xml",
"views/resource_booking_views.xml",
Expand Down
9 changes: 9 additions & 0 deletions resource_booking/data/mail_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" ?>
<odoo noupdate="1">
<record id="mail_activity_data_resource_booking" model="mail.activity.type">
<field name="category">resource_booking</field>
<field name="name">Resource Booking</field>
<field name="icon">fa-users</field>
<field name="sequence">11</field>
</record>
</odoo>
15 changes: 15 additions & 0 deletions resource_booking/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api


def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})

Check warning on line 7 in resource_booking/hooks.py

View check run for this annotation

Codecov / codecov/patch

resource_booking/hooks.py#L7

Added line #L7 was not covered by tests
# Remove new activity type resource booking and all activities associated'
activiy_resource_booking = env.ref(

Check warning on line 9 in resource_booking/hooks.py

View check run for this annotation

Codecov / codecov/patch

resource_booking/hooks.py#L9

Added line #L9 was not covered by tests
"resource_booking.mail_activity_data_resource_booking", raise_if_not_found=False
)
if activiy_resource_booking:
booking_activiy_ids = env["mail.activity"].search([("booking_id", "!=", False)])
booking_activiy_ids.unlink()
activiy_resource_booking.unlink()

Check warning on line 15 in resource_booking/hooks.py

View check run for this annotation

Codecov / codecov/patch

resource_booking/hooks.py#L13-L15

Added lines #L13 - L15 were not covered by tests
23 changes: 23 additions & 0 deletions resource_booking/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,12 @@ msgstr ""
msgid "Duration:"
msgstr ""

#. module: resource_booking
#: code:addons/resource_booking/models/mail_activity.py:0
#, python-format
msgid "Feedback: %(feedback)s"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_follower_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_follower_ids
Expand Down Expand Up @@ -762,6 +768,17 @@ msgstr ""
msgid "Next Activity Deadline"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_mail_activity_mixin__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_product__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_template__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_partner__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_users__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_booking_id
msgid "Next Activity Resource Booking"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_summary
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_summary
Expand Down Expand Up @@ -825,6 +842,11 @@ msgstr ""
msgid "Only one event per resource booking can exist."
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.mail_activity_view_form_popup
msgid "Open Resource Booking"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
msgid "Open a calendar to schedule a meeting for this booking request."
Expand Down Expand Up @@ -884,6 +906,7 @@ msgstr ""
#. module: resource_booking
#: model:ir.model,name:resource_booking.model_resource_booking
#: model:ir.module.category,name:resource_booking.category_resource_booking
#: model:mail.activity.type,name:resource_booking.mail_activity_data_resource_booking
msgid "Resource Booking"
msgstr ""

Expand Down
24 changes: 24 additions & 0 deletions resource_booking/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ msgstr "Activo"

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__booking_activity_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_ids
msgid "Activities"
msgstr "Actividades"
Expand Down Expand Up @@ -517,6 +518,12 @@ msgstr "La duración debe ser positiva."
msgid "Duration:"
msgstr "Duración:"

#. module: resource_booking
#: code:addons/resource_booking/models/mail_activity.py:0
#, python-format
msgid "Feedback: %(feedback)s"
msgstr "Retroalimentación: %(feedback)s"

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_follower_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_follower_ids
Expand Down Expand Up @@ -781,6 +788,17 @@ msgstr ""
msgid "Next Activity Deadline"
msgstr "Fecha límite de siguiente actividad"

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_mail_activity_mixin__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_product__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_template__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_partner__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_users__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_booking_id
msgid "Next Activity Resource Booking"
msgstr "Siguiente actividad de reserva de recursos"

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_summary
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_summary
Expand Down Expand Up @@ -844,6 +862,11 @@ msgstr "Número de mensajes no leídos"
msgid "Only one event per resource booking can exist."
msgstr "Solo puede existir un evento por reserva de recursos."

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.mail_activity_view_form_popup
msgid "Open Resource Booking"
msgstr "Abrir una reserva de recursos"

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
msgid "Open a calendar to schedule a meeting for this booking request."
Expand Down Expand Up @@ -910,6 +933,7 @@ msgstr "Aviso al solicitante"
#. module: resource_booking
#: model:ir.model,name:resource_booking.model_resource_booking
#: model:ir.module.category,name:resource_booking.category_resource_booking
#: model:mail.activity.type,name:resource_booking.mail_activity_data_resource_booking
msgid "Resource Booking"
msgstr "Reserva de recursos"

Expand Down
23 changes: 23 additions & 0 deletions resource_booking/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,12 @@ msgstr ""
msgid "Duration:"
msgstr ""

#. module: resource_booking
#: code:addons/resource_booking/models/mail_activity.py:0
#, python-format
msgid "Feedback: %(feedback)s"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_follower_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_follower_ids
Expand Down Expand Up @@ -756,6 +762,17 @@ msgstr ""
msgid "Next Activity Deadline"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_mail_activity_mixin__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_product__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_template__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_partner__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_users__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_booking_id
msgid "Next Activity Resource Booking"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_summary
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_summary
Expand Down Expand Up @@ -819,6 +836,11 @@ msgstr ""
msgid "Only one event per resource booking can exist."
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.mail_activity_view_form_popup
msgid "Open Resource Booking"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
msgid "Open a calendar to schedule a meeting for this booking request."
Expand Down Expand Up @@ -878,6 +900,7 @@ msgstr ""
#. module: resource_booking
#: model:ir.model,name:resource_booking.model_resource_booking
#: model:ir.module.category,name:resource_booking.category_resource_booking
#: model:mail.activity.type,name:resource_booking.mail_activity_data_resource_booking
msgid "Resource Booking"
msgstr ""

Expand Down
23 changes: 23 additions & 0 deletions resource_booking/i18n/fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,12 @@ msgstr "La durée doit être positive."
msgid "Duration:"
msgstr "Durée:"

#. module: resource_booking
#: code:addons/resource_booking/models/mail_activity.py:0
#, python-format
msgid "Feedback: %(feedback)s"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_follower_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_follower_ids
Expand Down Expand Up @@ -785,6 +791,17 @@ msgstr ""
msgid "Next Activity Deadline"
msgstr "Date limite de la prochaine activité"

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_mail_activity_mixin__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_product__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_product_template__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_partner__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_res_users__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_booking_id
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_booking_id
msgid "Next Activity Resource Booking"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_summary
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_summary
Expand Down Expand Up @@ -848,6 +865,11 @@ msgstr "Nombre de messages non lus"
msgid "Only one event per resource booking can exist."
msgstr "Un seul événement par réservation de ressource peut exister."

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.mail_activity_view_form_popup
msgid "Open Resource Booking"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
msgid "Open a calendar to schedule a meeting for this booking request."
Expand Down Expand Up @@ -913,6 +935,7 @@ msgstr "Avis au demandeur"
#. module: resource_booking
#: model:ir.model,name:resource_booking.model_resource_booking
#: model:ir.module.category,name:resource_booking.category_resource_booking
#: model:mail.activity.type,name:resource_booking.mail_activity_data_resource_booking
msgid "Resource Booking"
msgstr "Réservation de ressources"

Expand Down
39 changes: 39 additions & 0 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: 2024-03-01 11:24+0000\n"
"PO-Revision-Date: 2024-03-01 11:24+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -151,12 +153,24 @@ msgstr ""
msgid "Access warning"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_mail_activity_type__category
msgid "Action"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_needaction
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_needaction
msgid "Action Needed"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,help:resource_booking.field_mail_activity_type__category
msgid ""
"Actions may trigger specific behavior like opening calendar view or "
"automatically mark as done when a document is uploaded"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__active
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_combination__active
Expand All @@ -166,10 +180,16 @@ msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__booking_activity_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_ids
msgid "Activities"
msgstr ""

#. module: resource_booking
#: model:ir.model,name:resource_booking.model_mail_activity
msgid "Activity"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_exception_decoration
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_exception_decoration
Expand All @@ -182,6 +202,11 @@ msgstr ""
msgid "Activity State"
msgstr ""

#. module: resource_booking
#: model:ir.model,name:resource_booking.model_mail_activity_type
msgid "Activity Type"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__activity_type_icon
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__activity_type_icon
Expand Down Expand Up @@ -489,6 +514,12 @@ msgstr ""
msgid "Duration:"
msgstr ""

#. module: resource_booking
#: code:addons/resource_booking/models/mail_activity.py:0
#, python-format
msgid "Feedback: %(feedback)s"
msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking__message_follower_ids
#: model:ir.model.fields,field_description:resource_booking.field_resource_booking_type__message_follower_ids
Expand Down Expand Up @@ -815,6 +846,11 @@ msgstr ""
msgid "Only one event per resource booking can exist."
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.mail_activity_view_form_popup
msgid "Open Resource Booking"
msgstr ""

#. module: resource_booking
#: model_terms:ir.ui.view,arch_db:resource_booking.resource_booking_form
msgid "Open a calendar to schedule a meeting for this booking request."
Expand Down Expand Up @@ -874,6 +910,7 @@ msgstr ""
#. module: resource_booking
#: model:ir.model,name:resource_booking.model_resource_booking
#: model:ir.module.category,name:resource_booking.category_resource_booking
#: model:mail.activity.type,name:resource_booking.mail_activity_data_resource_booking
msgid "Resource Booking"
msgstr ""

Expand Down Expand Up @@ -904,6 +941,8 @@ msgstr ""

#. module: resource_booking
#: model:ir.model.fields,field_description:resource_booking.field_calendar_event__resource_booking_ids
#: model:ir.model.fields,field_description:resource_booking.field_mail_activity__booking_id
#: model:ir.model.fields.selection,name:resource_booking.selection__mail_activity_type__category__resource_booking
msgid "Resource booking"
msgstr ""

Expand Down
1 change: 1 addition & 0 deletions resource_booking/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
from . import resource_booking_type_combination_rel
from . import resource_calendar
from . import resource_resource
from . import mail_activity
Loading

0 comments on commit e73ccfc

Please sign in to comment.