summaryrefslogtreecommitdiff
path: root/addons/project/static
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2020-05-14 13:44:05 +0000
committerYannick Tivisse <yti@odoo.com>2020-05-25 12:44:14 +0000
commit45f3659305359fff5b0c7bf3de7d49a25ba5c36d (patch)
tree05eb674b1adf2cf31f96d8344dfef83bbced4a03 /addons/project/static
parentf27baf0c94d978d21900cbc85368d97c113fea2a (diff)
[IMP] project,...: Improve list views with new widgets
Purpose ======= Task 2195254 introduced many wonderful widgets to pimp the list view. This task aims at implemeting them into the Services apps: project, timesheets, helpdesk, expense, planning and field service. Remaining days: https://drive.google.com/file/d/1o4Wn47445GxLqBkw-ifH9MgtFU_437xz/view Avatar: https://drive.google.com/file/d/1yDwJWP0MZCUKZbqCa8hte1ziVTYRMMtb/view Activities: https://drive.google.com/file/d/1e_rXH50eZq4zY2HOzw7_pfgiD39SoRIl/view Field-specific decorations: https://drive.google.com/file/d/1WFnqJ-jkyDFftRHxWW4bgomoWrOpOuaY/view More control on buttons Specifications ============== You will find below a list of which widgets to apply to which fields by model. Some changes have to be done in the form/kanban views as well. 1) project.task remaining days -> date_deadline -> list + kanban + form views hide this field if is_closed is true avatar -> user_id -> list view activities -> 'next activity' field to be added -> list view field-specific decorations https://nimb.ws/ACewrY remove the current orange/red decorations we have if planned_hours > 0, display the remaining_hours field in (list view): red if progress is > 100% orange if progress is between 80% and 100% green if progress is <80% display unit_amount in red if > 24:00 -> form view 2) rating.rating display the rating in: green = satisfied orange = not_satisfied red = highly_dissatisfied list + form views 3) project.project avatar -> user_id -> list + form views 4) account.analytic.line avatar -> employee_id -> list view display unit_amount in red if > 24:00 -> list + kanban + form view https://nimb.ws/eIWa7E merge the timer and duration fields together 5) helpdesk.ticket avatar user_id -> list view employee_id under timesheet_ids -> form view remaining hours -> sla_deadline activities -> 'next activity' field to be added -> list view field specific decoration -> display unit_amount in red if > 24:00 -> form view 6) hr.expense avatar -> employee_id -> list view activities -> 'next activity' field to be added -> list view badge -> state -> list view draft = blue reported = green approved = green done = green refused = red combine the unit_amount and the currency_id fields (see the total_amount field for reference) -> list view (idem for the expense_line_ids one2many on hr.expense.sheet) display the total_amount in bold move 'company_id' before 'amount' 7) hr.expense.sheet avatar employee_id -> list view user_id -> list view activities -> 'next activity' field to be added -> list view badge -> state -> list view draft = blue submit = green approve = green post = green done = green cancel = red display the total_amount in bold move 'company_id' before 'amount' 8) planning.slot avatar -> employee_id -> list view decoration display the allocated_percentage field in red if > 100% -> list + form view display the forecast_hours field in red if > planned hours and if planned_hours > 0 -> form view display the effective_hours field in red if > forecast_hours and if forecast_hours > 0 -> form view 9) misc calendar.event -> avatar -> user_id -> form view mail.activity.type -> combine the delay_count and delay_unit fields together -> list view note.note -> 'next activity' field to be added -> list view crm.lead.mining.request combine the lead_number and lead_type fields together -> list view display the name in bold badge -> state draft = blue done = green error = red planning.slot.template -> display the duration field in red if it is = 0 closes odoo/odoo#51271 Taskid: 2248351 Related: odoo/enterprise#10605 Related: odoo/upgrade#1252 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/project/static')
-rw-r--r--addons/project/static/src/js/project.js47
1 files changed, 0 insertions, 47 deletions
diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js
deleted file mode 100644
index 5e0062a9965..00000000000
--- a/addons/project/static/src/js/project.js
+++ /dev/null
@@ -1,47 +0,0 @@
-odoo.define('project.update_kanban', function (require) {
-'use strict';
-
-var KanbanRecord = require('web.KanbanRecord');
-var basic_fields = require('web.basic_fields');
-var registry = require('web.field_registry');
-
-KanbanRecord.include({
- //--------------------------------------------------------------------------
- // Private
- //--------------------------------------------------------------------------
-
- /**
- * @override
- * @private
- */
- _openRecord: function () {
- if (this.modelName === 'project.project' && this.$(".o_project_kanban_boxes a").length) {
- this.$('.o_project_kanban_boxes a').first().click();
- } else {
- this._super.apply(this, arguments);
- }
- },
-
-});
-
-var FieldTaskClosedDeadline = basic_fields.FieldDate.extend({
- _renderReadonly: function () {
- if (this.value && this.value.toISOString()) {
- var deadline = moment(this.value.toISOString()).startOf('day');
- var task_closed = 'is_closed' in this.record.data && this.record.data.is_closed;
-
- if (!task_closed && deadline < moment().startOf('day')) {
- this.$el.addClass('text-danger font-weight-bold');
- } else if (!task_closed && deadline < moment().endOf('day')) {
- this.$el.addClass('text-warning font-weight-bold');
- }
- }
-
- this.$el.text(this._formatValue(this.value));
- }
-});
-
-registry.add('task_closed_deadline', FieldTaskClosedDeadline);
-
-return FieldTaskClosedDeadline;
-});