From 4e41bc3d1b72576f8a53f95a9e9a6063f4e28506 Mon Sep 17 00:00:00 2001 From: Leonardo Pavan Rocha Date: Thu, 2 Nov 2023 14:29:43 +0100 Subject: [PATCH] [FIX] calendar: move calendar integration from cog menu to module settings Currently the calendar integration can be accessed from the cog menu when in the calendar module in the calendar view. However, it is a bit hidden. This commit removes the button for calendar integration in the cog menu and also we move the calendar integration settings from the general settings to a new calendar specific settings page. task-3570053 Part-of: odoo/odoo#139736 --- .../views/res_config_settings_views.xml | 12 ----- addons/calendar/__manifest__.py | 1 + .../calendar_sync_cog_menu.js | 44 ------------------- .../calendar_sync_cog_menu.xml | 8 ---- addons/calendar/views/calendar_views.xml | 19 +++++++- .../views/res_config_settings_views.xml | 28 ++++++++++++ .../views/res_config_settings_views.xml | 2 +- .../views/res_config_settings_views.xml | 2 +- 8 files changed, 49 insertions(+), 67 deletions(-) delete mode 100644 addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.js delete mode 100644 addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.xml create mode 100644 addons/calendar/views/res_config_settings_views.xml diff --git a/addons/base_setup/views/res_config_settings_views.xml b/addons/base_setup/views/res_config_settings_views.xml index 76adcdea10e..8254d1b65e7 100644 --- a/addons/base_setup/views/res_config_settings_views.xml +++ b/addons/base_setup/views/res_config_settings_views.xml @@ -140,18 +140,6 @@ - - -
-
Save this page and come back here to set up the feature.
-
-
- - -
-
Save this page and come back here to set up the feature.
-
-
diff --git a/addons/calendar/__manifest__.py b/addons/calendar/__manifest__.py index b4919c79173..d1eb6d1126c 100644 --- a/addons/calendar/__manifest__.py +++ b/addons/calendar/__manifest__.py @@ -34,6 +34,7 @@ If you need to manage your meetings, you should install the CRM module. 'views/mail_activity_views.xml', 'views/calendar_templates.xml', 'views/calendar_views.xml', + 'views/res_config_settings_views.xml', 'views/res_partner_views.xml', 'wizard/calendar_provider_config.xml', 'wizard/calendar_popover_delete_wizard.xml', diff --git a/addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.js b/addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.js deleted file mode 100644 index fc7b45ea215..00000000000 --- a/addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.js +++ /dev/null @@ -1,44 +0,0 @@ -/** @odoo-module */ - -import { _t } from "@web/core/l10n/translation"; -import { registry } from "@web/core/registry"; -import { Component } from "@odoo/owl"; -import { useService } from "@web/core/utils/hooks"; -import { DropdownItem } from "@web/core/dropdown/dropdown_item"; - -const cogMenuRegistry = registry.category("cogMenu"); - -export class CalendarSyncCogMenu extends Component { - static props = {}; - static template = "calendar.CalendarSyncCogMenu"; - static components = { DropdownItem }; - - setup() { - this.actionService = useService("action"); - } - - startCalendarSync() { - this.actionService.doAction({ - name: _t('Connect your Calendar'), - type: 'ir.actions.act_window', - res_model: 'calendar.provider.config', - views: [[false, "form"]], - view_mode: "form", - target: 'new', - context: { - 'dialog_size': 'medium', - } - }); - } -}; - -cogMenuRegistry.add( - 'calendar-sync-cog-menu', - { - Component: CalendarSyncCogMenu, - groupNumber: 10, - isDisplayed: ({ config }) => { - return config.viewSubType === "attendee_calendar"; - }, - }, -); diff --git a/addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.xml b/addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.xml deleted file mode 100644 index 93781d2d613..00000000000 --- a/addons/calendar/static/src/components/calendar_sync_cog_menu/calendar_sync_cog_menu.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - Add integrations - - - diff --git a/addons/calendar/views/calendar_views.xml b/addons/calendar/views/calendar_views.xml index 8539b2f4d6a..c94d2c23b05 100644 --- a/addons/calendar/views/calendar_views.xml +++ b/addons/calendar/views/calendar_views.xml @@ -468,6 +468,14 @@ {'dialog_size': 'medium'} + + Settings + res.config.settings + form + inline + {'module' : 'calendar', 'bin_size': False} + + + groups="base.group_system,base.group_no_one"/> + + diff --git a/addons/calendar/views/res_config_settings_views.xml b/addons/calendar/views/res_config_settings_views.xml new file mode 100644 index 00000000000..86caf743290 --- /dev/null +++ b/addons/calendar/views/res_config_settings_views.xml @@ -0,0 +1,28 @@ + + + + res.config.settings.view.form.inherit.calendar + res.config.settings + + + + + + + +
+
Save this page and come back here to set up the feature.
+
+
+ + +
+
Save this page and come back here to set up the feature.
+
+
+
+
+
+
+
+
diff --git a/addons/google_calendar/views/res_config_settings_views.xml b/addons/google_calendar/views/res_config_settings_views.xml index 2232ae20bbe..41523d8a5e1 100644 --- a/addons/google_calendar/views/res_config_settings_views.xml +++ b/addons/google_calendar/views/res_config_settings_views.xml @@ -3,7 +3,7 @@ res.config.settings.view.form.inherit.google.calendar res.config.settings - +
diff --git a/addons/microsoft_calendar/views/res_config_settings_views.xml b/addons/microsoft_calendar/views/res_config_settings_views.xml index 2b88df4e1a9..e824636f176 100644 --- a/addons/microsoft_calendar/views/res_config_settings_views.xml +++ b/addons/microsoft_calendar/views/res_config_settings_views.xml @@ -3,7 +3,7 @@ res.config.settings.view.form.inherit.microsoft.calendar res.config.settings - +