From 45f3659305359fff5b0c7bf3de7d49a25ba5c36d Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 14 May 2020 13:44:05 +0000 Subject: [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) --- addons/timer/static/src/js/timer_toggle_button.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/timer/static/src/js/timer_toggle_button.js') diff --git a/addons/timer/static/src/js/timer_toggle_button.js b/addons/timer/static/src/js/timer_toggle_button.js index 1bb5c2185d7..78274e05e0c 100644 --- a/addons/timer/static/src/js/timer_toggle_button.js +++ b/addons/timer/static/src/js/timer_toggle_button.js @@ -3,6 +3,7 @@ odoo.define('timer.timer_toggle_button', function (require) { const fieldRegistry = require('web.field_registry'); const { FieldToggleBoolean } = require("web.basic_fields"); +const { _lt } = require('web.core'); /** * The TimerToggleButton is used to display correctly the button @@ -16,9 +17,9 @@ const TimerToggleButton = FieldToggleBoolean.extend({ */ _render: function () { // When the is_timer_running field is false, then the button is used to start the timer - const title = this.value ? 'stop' : 'play'; + const title = this.value ? _lt('Stop') : _lt('Play'); const name = this.value ? 'action_timer_stop' : 'action_timer_start'; - const label = this.value ? 'stop' : 'start'; + const label = this.value ? _lt('Stop') : _lt('Start'); this.$('i') .addClass('fa') -- cgit v1.2.3