[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
This commit is contained in:
Leonardo Pavan Rocha
2023-11-04 00:38:21 +00:00
parent 031cfa321b
commit 4e41bc3d1b
8 changed files with 49 additions and 67 deletions
@@ -140,18 +140,6 @@
<setting string="Mail Plugin" documentation="/applications/productivity/mail_plugins.html" help="Integrate with mail client plugins" id="mail_pluggin_setting">
<field name="module_mail_plugin" />
</setting>
<setting string="Outlook Calendar" documentation="/applications/productivity/calendar/outlook.html" help="Synchronize your calendar with Outlook" id="sync_outlook_calendar_setting">
<field name="module_microsoft_calendar" />
<div class="content-group" invisible="not module_microsoft_calendar" id="msg_module_microsoft_calendar">
<div class="text-warning mt16"><strong>Save</strong> this page and come back here to set up the feature.</div>
</div>
</setting>
<setting string="Google Calendar" documentation="/applications/productivity/calendar/google.html" help="Synchronize your calendar with Google Calendar" id="sync_google_calendar_setting">
<field name="module_google_calendar"/>
<div class="content-group" invisible="not module_google_calendar" id="msg_module_google_calendar">
<div class="text-warning mt16"><strong>Save</strong> this page and come back here to set up the feature.</div>
</div>
</setting>
<div id="product_get_pic_setting"/>
<setting string="OAuth Authentication" help="Use external accounts to log in (Google, Facebook, etc.)" id="module_auth_oauth">
<field name="module_auth_oauth" />
+1
View File
@@ -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',
@@ -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";
},
},
);
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="calendar.CalendarSyncCogMenu">
<DropdownItem class="'o_calendar_sync_menu'" onSelected.bind="startCalendarSync">
<i class="fa fa-fw fa-calendar me-1"/>Add integrations
</DropdownItem>
</t>
</templates>
+18 -1
View File
@@ -468,6 +468,14 @@
<field name="context">{'dialog_size': 'medium'}</field>
</record>
<record id="calendar_settings_action" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="res_model">res.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'calendar', 'bin_size': False}</field>
</record>
<!-- Menus -->
<menuitem
id="mail_menu_calendar"
@@ -490,12 +498,21 @@
name="Configuration"
sequence="40"
action="calendar.action_calendar_event"
groups="base.group_no_one"/>
groups="base.group_system,base.group_no_one"/>
<menuitem
id="menu_calendar_settings"
parent="calendar_menu_config"
name="Settings"
sequence="45"
action="calendar_settings_action"
groups="base.group_system"/>
<menuitem
id="calendar_submenu_reminders"
parent="calendar_menu_config"
name="Reminders"
sequence="50"
action="action_calendar_alarm"
groups="base.group_no_one"/>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.calendar</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="Calendar" string="Calendar" name="calendar" groups="base.group_system">
<block title="Calendar Settings" name="calendar">
<setting string="Outlook Calendar" documentation="/applications/productivity/calendar/outlook.html" help="Synchronize your calendar with Outlook" id="sync_outlook_calendar_setting">
<field name="module_microsoft_calendar" />
<div class="content-group" invisible="not module_microsoft_calendar" id="msg_module_microsoft_calendar">
<div class="text-warning mt16"><strong>Save</strong> this page and come back here to set up the feature.</div>
</div>
</setting>
<setting string="Google Calendar" documentation="/applications/productivity/calendar/google.html" help="Synchronize your calendar with Google Calendar" id="sync_google_calendar_setting">
<field name="module_google_calendar"/>
<div class="content-group" invisible="not module_google_calendar" id="msg_module_google_calendar">
<div class="text-warning mt16"><strong>Save</strong> this page and come back here to set up the feature.</div>
</div>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>
@@ -3,7 +3,7 @@
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.google.calendar</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
<field name="inherit_id" ref="calendar.res_config_settings_view_form"/>
<field name="arch" type="xml">
<div id="msg_module_google_calendar" position="replace">
<div class="content-group" invisible="not module_google_calendar">
@@ -3,7 +3,7 @@
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.microsoft.calendar</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
<field name="inherit_id" ref="calendar.res_config_settings_view_form"/>
<field name="arch" type="xml">
<div id="msg_module_microsoft_calendar" position="replace">
<div class="content-group" invisible="not module_microsoft_calendar">