[IMP] project: improve calendar view
Before this commit, the calendar view showcases tasks by deadline. Because it is a simple date field, the day/week modes don't have much value and are even confusing to the users, who expect to be able to define timeframes. In addition, the quickcreate doesn't allow to select a project. This is problematic because it leads to "ghost" tasks. closes odoo/odoo#52478 Taskid: 2264594 Related: odoo/enterprise#10976 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
odoo.define('project.ProjectCalendarView', function (require) {
|
||||
"use strict";
|
||||
|
||||
const CalendarController = require('web.CalendarController');
|
||||
const CalendarView = require('web.CalendarView');
|
||||
const viewRegistry = require('web.view_registry');
|
||||
|
||||
const ProjectCalendarController = CalendarController.extend({
|
||||
_renderButtonsParameters() {
|
||||
return _.extend({}, this._super(...arguments), {scaleDrop: true});
|
||||
},
|
||||
});
|
||||
|
||||
const ProjectCalendarView = CalendarView.extend({
|
||||
config: _.extend({}, CalendarView.prototype.config, {
|
||||
Controller: ProjectCalendarController,
|
||||
}),
|
||||
});
|
||||
|
||||
viewRegistry.add('project_calendar', ProjectCalendarView);
|
||||
return ProjectCalendarView;
|
||||
});
|
||||
@@ -7,6 +7,7 @@
|
||||
<script type="text/javascript" src="/project/static/src/js/project_rating_reporting.js"></script>
|
||||
<script type="text/javascript" src="/project/static/src/js/project_task_kanban_examples.js"></script>
|
||||
<script type="text/javascript" src="/project/static/src/js/tours/project.js"></script>
|
||||
<script type="text/javascript" src="/project/static/src/js/project_calendar.js"></script>
|
||||
<link rel="stylesheet" type="text/scss" href="/project/static/src/scss/project_dashboard.scss"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
@@ -873,7 +873,8 @@
|
||||
<field name="model">project.task</field>
|
||||
<field eval="2" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar date_start="date_deadline" string="Tasks" mode="month" color="user_id" event_limit="5" hide_time="true">
|
||||
<calendar date_start="date_deadline" string="Tasks" mode="month" color="user_id" event_limit="5"
|
||||
hide_time="true" quick_add="False" js_class="project_calendar">
|
||||
<field name="user_id" avatar_field="image_128" filters="1"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="project_id"/>
|
||||
|
||||
@@ -91,8 +91,14 @@
|
||||
|
||||
<t t-name="CalendarView.buttons">
|
||||
<div class="o_calendar_buttons">
|
||||
<t t-call="CalendarView.navigation_buttons" />
|
||||
<t t-call="CalendarView.scale_buttons" />
|
||||
<span class="o_calendar_navigation_buttons">
|
||||
<t t-call="CalendarView.navigation_buttons" />
|
||||
</span>
|
||||
<t t-if="!scaleDrop">
|
||||
<span class="o_calendar_scale_buttons">
|
||||
<t t-call="CalendarView.scale_buttons" />
|
||||
</span>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user