Files
odoo_source/addons/note/views/note_views.xml
T
Yannick Tivisse 45f3659305 [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>
2020-05-25 12:44:14 +00:00

242 lines
9.7 KiB
XML

<?xml version="1.0"?>
<odoo>
<!-- note Stage Form View -->
<record id="view_note_stage_form" model="ir.ui.view">
<field name="name">note.stage.form</field>
<field name="model">note.stage</field>
<field name="arch" type="xml">
<form string="Stage of Notes">
<group>
<field name="name"/>
<field name="fold"/>
</group>
</form>
</field>
</record>
<!-- note Stage Tree View -->
<record id="view_note_stage_tree" model="ir.ui.view">
<field name="name">note.stage.tree</field>
<field name="model">note.stage</field>
<field name="field_parent"></field>
<field name="arch" type="xml">
<tree string="Stages of Notes" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="fold"/>
</tree>
</field>
</record>
<!-- note Stage Action -->
<record id="action_note_stage" model="ir.actions.act_window">
<field name="name">Stages</field>
<field name="res_model">note.stage</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('user_id','=',uid)]</field>
</record>
<!-- note Tag Form View -->
<record id="note_tag_view_form" model="ir.ui.view">
<field name="name">note.tag.form</field>
<field name="model">note.tag</field>
<field name="arch" type="xml">
<form string="Tags">
<group>
<field name="name"/>
</group>
</form>
</field>
</record>
<!-- note Tag Tree View -->
<record id="note_tag_view_tree" model="ir.ui.view">
<field name="name">note.tag.tree</field>
<field name="model">note.tag</field>
<field name="arch" type="xml">
<tree string="Tags" editable="bottom">
<field name="name"/>
</tree>
</field>
</record>
<!-- note Tag Action -->
<record id="note_tag_action" model="ir.actions.act_window">
<field name="name">Tags</field>
<field name="res_model">note.tag</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Add a new tag
</p>
</field>
</record>
<!-- New note Kanban View -->
<record id="view_note_note_kanban" model="ir.ui.view">
<field name="name">note.note.kanban</field>
<field name="model">note.note</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id" class="oe_notes oe_kanban_quickcreate_textarea o_kanban_small_column">
<field name="color"/>
<field name="sequence"/>
<field name="name"/>
<field name="stage_id"/>
<field name="open"/>
<field name="memo"/>
<field name="date_done"/>
<field name="message_partner_ids"/>
<field name="activity_ids" />
<field name="activity_state" />
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''} oe_kanban_global_click_edit oe_semantic_html_override oe_kanban_card">
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<div class="o_dropdown_kanban dropdown">
<a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" data-display="static" href="#" aria-label="Dropdown menu" title="Dropdown menu">
<span class="fa fa-ellipsis-v"/>
</a>
<div class="dropdown-menu" role="menu">
<a role="menuitem" type="delete" class="dropdown-item">Delete</a>
<ul class="oe_kanban_colorpicker" data-field="color"/>
</div>
</div>
<span>
<a name="action_close" type="object" t-if="record.open.raw_value"><i class="fa fa-check" role="img" aria-label="Opened" title="Opened"/></a>
<a name="action_open" type="object" t-if="!record.open.raw_value"><i class="fa fa-undo" role="img" aria-label="Closed" title="Closed"/></a>
</span>
<!-- kanban note -->
<span t-attf-class="oe_kanban_content #{record.open.raw_value ? '' : 'note_text_line_through'}">
<!-- title -->
<field name="name"/>
<div class="o_kanban_inline_block float-right mr4">
<field name="activity_ids" widget="kanban_activity" />
</div>
</span>
<t t-if="record.message_partner_ids.raw_value.length &gt; 1">
<div class="clearfix"></div>
<t t-foreach="record.message_partner_ids.raw_value" t-as="follower">
<img t-att-src="kanban_image('res.partner', 'image_128', follower)" class="oe_kanban_avatar o_image_24_cover float-right mt-2" t-att-data-member_id="follower" alt="Follower"/>
</t>
<div class="clearfix"></div>
</t>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- New note Tree View -->
<record id="view_note_note_tree" model="ir.ui.view">
<field name="name">note.note.tree</field>
<field name="model">note.note</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="name"/>
<field name="open"/>
<field name="stage_id"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
</tree>
</field>
</record>
<!-- New note Form View -->
<record id="view_note_note_form" model="ir.ui.view">
<field name="name">note.note.form</field>
<field name="model">note.note</field>
<field name="arch" type="xml">
<form string="Note" class="oe_form_nomargin o_note_form_view">
<header>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" placeholder="Tags"/>
<field name="stage_id" domain="[('user_id','=',uid)]" widget="statusbar" options="{'clickable': '1'}"/>
</header>
<sheet>
<field name="memo" type="html" class="oe_memo"/>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<!-- Search note -->
<record id="view_note_note_filter" model="ir.ui.view">
<field name="name">note.note.search</field>
<field name="model">note.note</field>
<field name="arch" type="xml">
<search string="Notes">
<field name="memo" string="Note"/>
<field name="tag_ids"/>
<filter name="open_true" string="Active" domain="[('open', '=', True)]"/>
<filter name="open_false" string="Archive" domain="[('open', '=', False)]"/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
]"/>
<group expand="0" string="Group By">
<filter string="Stage" name="stage" help="By sticky note Category" context="{'group_by':'stage_id'}"/>
</group>
</search>
</field>
</record>
<!-- Action -->
<record id="action_note_note" model="ir.actions.act_window">
<field name="name">Notes</field>
<field name="res_model">note.note</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="search_view_id" ref="view_note_note_filter"/>
<field name="context">{}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Add a new personal note
</p><p>
Notes are private, unless you share them by inviting follower on a note.
(Useful for meeting minutes).
</p>
</field>
</record>
<menuitem
id="menu_note_notes"
name="Notes"
sequence="3"
action="note.action_note_note"
web_icon="note,static/description/icon.png"/>
<menuitem
id="menu_note_configuration"
name="Configuration"
sequence="100"
parent="menu_note_notes"
groups="base.group_no_one"/>
<menuitem
id="menu_notes_stage"
name="Stages"
parent="menu_note_configuration"
action="note.action_note_stage"
sequence="21"/>
<menuitem
id="notes_tag_menu"
parent="menu_note_configuration"
action="note_tag_action"
sequence="22"/>
</odoo>