summaryrefslogtreecommitdiff
path: root/addons/project/views
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/views
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/views')
-rw-r--r--addons/project/views/project_assets.xml1
-rw-r--r--addons/project/views/project_views.xml31
2 files changed, 10 insertions, 22 deletions
diff --git a/addons/project/views/project_assets.xml b/addons/project/views/project_assets.xml
index 347f620f386..e6e6dddeea2 100644
--- a/addons/project/views/project_assets.xml
+++ b/addons/project/views/project_assets.xml
@@ -3,7 +3,6 @@
<template id="assets_backend" name="project assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/project/static/src/css/project.css"/>
- <script type="text/javascript" src="/project/static/src/js/project.js"></script>
<script type="text/javascript" src="/project/static/src/js/project_kanban.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>
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index 80f725c5f0f..f35e189f9ae 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -291,7 +291,7 @@
<group>
<group>
<field name="active" invisible="1"/>
- <field name="user_id" string="Project Manager" attrs="{'readonly':[('active','=',False)]}" domain="[('share', '=', False)]"/>
+ <field name="user_id" string="Project Manager" widget="many2one_avatar_user" attrs="{'readonly':[('active','=',False)]}" domain="[('share', '=', False)]"/>
<field name="partner_id" string="Customer"/>
</group>
<group>
@@ -404,7 +404,7 @@
<field name="message_needaction" invisible="1"/>
<field name="active" invisible="1"/>
<field name="name" string="Project Name"/>
- <field name="user_id" optional="show" string="Project Manager"/>
+ <field name="user_id" optional="show" string="Project Manager" widget="many2one_avatar_user"/>
<field name="partner_id" optional="show" string="Contact"/>
<field name="analytic_account_id" optional="hide"/>
<field name="privacy_visibility" optional="hide"/>
@@ -666,7 +666,7 @@
domain="[('parent_id', '=', False)]"
attrs="{'invisible' : [('allow_subtasks', '=', False)]}"
/>
- <field name="date_deadline" widget="task_closed_deadline" />
+ <field name="date_deadline" widget="remaining_days" attrs="{'invisible': [('is_closed', '=', True)]}"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
</group>
</group>
@@ -761,8 +761,6 @@
<field name="user_id"/>
<field name="partner_id"/>
<field name="sequence"/>
- <field name="date_deadline"/>
- <field name="date_deadline_formatted"/>
<field name="is_closed"/>
<field name="partner_is_company"/>
<field name="displayed_image_id"/>
@@ -823,19 +821,9 @@
<span style="font-weight:bold;" class="fa fa-fw mt4 fa-meh-o text-warning" t-if="record.rating_last_value.value == 3" title="Latest Rating: Not Satisfied" role="img" aria-label="Neutral face"/>
<span style="font-weight:bold;" class="fa fa-fw mt4 fa-frown-o text-danger" t-if="record.rating_last_value.value == 1" title="Latest Rating: Higly Dissatisfied" role="img" aria-label="Sad face"/>
</b>
- <!-- formating of the date -->
- <t t-set="date_format" t-value="'MM/DD/YY'" />
- <t t-set="date" t-value=""/>
- <!-- color of the span -->
- <t t-if="!record.is_closed.raw_value and record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().startOf('day')">
- <t t-set="deadline_class" t-value="'oe_kanban_text_red'" />
- </t>
- <t t-elif="!record.is_closed.raw_value and record.date_deadline.raw_value and moment(record.date_deadline.raw_value.toISOString()).startOf('day') lt moment().endOf('day')">
- <t t-set="deadline_class" t-value="'text-warning font-weight-bold'" />
- </t>
- <!-- Date value -->
- <t t-if="record.date_deadline.raw_value" t-set="date" t-value="record.date_deadline_formatted.raw_value" />
- <span name="date" title="Deadline" t-attf-class="#{deadline_class || ''}"><t t-esc="date" /></span>
+ <div name="date_deadline" attrs="{'invisible': [('is_closed', '=', True)]}">
+ <field name="date_deadline" widget="remaining_days"/>
+ </div>
</div>
<div class="oe_kanban_bottom_right" t-if="!selection_mode">
<field name="kanban_state" widget="state_selection" groups="base.group_user" invisible="context.get('fsm_mode', False)"/>
@@ -856,7 +844,7 @@
<field name="model">project.task</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
- <tree decoration-danger="not is_closed and date_deadline and (date_deadline&lt;current_date)" string="Tasks" multi_edit="1">
+ <tree string="Tasks" multi_edit="1">
<field name="message_needaction" invisible="1" readonly="1"/>
<field name="is_closed" invisible="1" />
<field name="sequence" invisible="not context.get('seq_visible', False)" readonly="1"/>
@@ -865,8 +853,9 @@
<field name="project_id" invisible="context.get('user_invisible', False)" optional="show" readonly="1"/>
<field name="partner_id" optional="hide"/>
<field name="parent_id" groups="project.group_subtask_project" optional="show"/>
- <field name="user_id" invisible="context.get('user_invisible', False)" optional="show"/>
- <field name="date_deadline" optional="hide"/>
+ <field name="user_id" invisible="context.get('user_invisible', False)" optional="show" widget="many2one_avatar_user"/>
+ <field name="activity_ids" widget="list_activity" optional="show"/>
+ <field name="date_deadline" optional="hide" widget="remaining_days" attrs="{'invisible': [('is_closed', '=', True)]}"/>
<field name="stage_id" invisible="context.get('set_visible',False)" optional="show" readonly="1"/>
<field name="tag_ids" optional="hide" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="company_id" groups="base.group_multi_company" optional="show"/>