[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
This commit is contained in:
Vincent Larcin
2022-05-05 15:14:27 +02:00
parent 52b621e8bc
commit 2df9e08eff
@@ -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,
}),
});