[IMP] project: migrate project_calendar to wowl2
closes odoo/odoo#101603 X-original-commit: fb7c615fcec3743f31d34ebb79664f8a8eb5a50f Related: odoo/enterprise#32012 Signed-off-by: Xavier <xbo@odoo.com> Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit is contained in:
@@ -73,7 +73,6 @@
|
||||
'project/static/src/js/project_rating_pivot_view.js',
|
||||
'project/static/src/js/project_task_kanban_examples.js',
|
||||
'project/static/src/js/tours/project.js',
|
||||
'project/static/src/js/project_calendar.js',
|
||||
'project/static/src/js/widgets/*',
|
||||
'project/static/src/scss/project_dashboard.scss',
|
||||
'project/static/src/scss/project_form.scss',
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/** @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';
|
||||
|
||||
const ProjectCalendarController = CalendarController.extend({
|
||||
/**
|
||||
* @private
|
||||
* @param {OdooEvent} event
|
||||
*/
|
||||
_onChangeDate: function (event) {
|
||||
this._super.apply(this, arguments);
|
||||
this.model.setScale('month');
|
||||
this.model.setDate(event.data.date);
|
||||
this.reload();
|
||||
},
|
||||
});
|
||||
|
||||
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,
|
||||
}),
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
init: function (viewInfo, params) {
|
||||
this._super.apply(this, arguments);
|
||||
this.controllerParams.displayName += " - Tasks by Deadline";
|
||||
}
|
||||
});
|
||||
|
||||
viewRegistry.add('project_calendar', ProjectCalendarView);
|
||||
@@ -0,0 +1,10 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { CalendarController } from "@web/views/calendar/calendar_controller";
|
||||
|
||||
export class ProjectCalendarController extends CalendarController {
|
||||
setup() {
|
||||
super.setup(...arguments);
|
||||
this.displayName += this.env._t(" - Tasks by Deadline");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { calendarView } from "@web/views/calendar/calendar_view";
|
||||
import { ProjectCalendarController } from "@project/views/project_calendar/project_calendar_controller";
|
||||
import { ProjectControlPanel } from "@project/components/project_control_panel/project_control_panel";
|
||||
|
||||
export const projectCalendarView = {
|
||||
...calendarView,
|
||||
Controller: ProjectCalendarController,
|
||||
ControlPanel: ProjectControlPanel,
|
||||
};
|
||||
registry.category("views").add("project_calendar", projectCalendarView);
|
||||
@@ -173,7 +173,7 @@ tour.register('project_update_tour', {
|
||||
}, ...openProjectUpdateAndReturnToTasks("Pivot", "o_pivot_view"), {
|
||||
trigger: '.o_switch_view.o_calendar',
|
||||
content: 'Open Calendar View of Tasks',
|
||||
}, ...openProjectUpdateAndReturnToTasks("Calendar", "o_legacy_calendar_view"), {
|
||||
}, ...openProjectUpdateAndReturnToTasks("Calendar", "o_calendar_view"), {
|
||||
trigger: '.o_switch_view.o_activity',
|
||||
content: 'Open Activity View of Tasks',
|
||||
}, ...openProjectUpdateAndReturnToTasks("Activity", "o_activity_view"),
|
||||
|
||||
Reference in New Issue
Block a user