From 2df9e08efffef71ae7444423a06148eeb4be171a Mon Sep 17 00:00:00 2001 From: Vincent Larcin Date: Fri, 18 Feb 2022 11:02:30 +0000 Subject: [PATCH] [IMP] project: disable task resizing in planning view In the fullcalendar library, you can by default resize events with the mouse to alter the start and end dates. However, since for project tasks, we use the calendar to show deadlines, it wouldn't make sense to resize them. This commit therefore disables the ability to resize tasks. Task-2741733 Part-of: odoo/odoo#86008 --- addons/project/static/src/js/project_calendar.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/project/static/src/js/project_calendar.js b/addons/project/static/src/js/project_calendar.js index d8db099a2b7..37943fad6ed 100644 --- a/addons/project/static/src/js/project_calendar.js +++ b/addons/project/static/src/js/project_calendar.js @@ -1,6 +1,7 @@ /** @odoo-module **/ import CalendarController from 'web.CalendarController'; +import CalendarModel from 'web.CalendarModel'; import CalendarView from 'web.CalendarView'; import viewRegistry from 'web.view_registry'; import { ProjectControlPanel } from '@project/js/project_control_panel'; @@ -18,10 +19,23 @@ const ProjectCalendarController = CalendarController.extend({ }, }); +const ProjectCalendarModel = CalendarModel.extend({ + /** + * @private + * @override + */ + _getFullCalendarOptions: function () { + const options = this._super(...arguments); + options.eventDurationEditable = false; + return options; + } +}) + export const ProjectCalendarView = CalendarView.extend({ config: Object.assign({}, CalendarView.prototype.config, { Controller: ProjectCalendarController, ControlPanel: ProjectControlPanel, + Model: ProjectCalendarModel, }), });