odoo/packs/odoo.v18/base/magic_note/views/project_task_views.xml

108 lines
6.3 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Inherits the form view of project.task.note to add new field 'deadline' -->
<record id="project_task_view_todo_form" model="ir.ui.view">
<field name="name">project.task.view.form.inherit.magic.note</field>
<field name="model">project.task</field>
<field name="inherit_id"
ref="project_todo.project_task_view_todo_form"/>
<field name="arch" type="xml">
<xpath expr="//header/field[@name='personal_stage_type_id']" position="after">
<div class="py-1 px-2 border rounded bg-view">
<field name="deadline"/>
</div>
</xpath>
</field>
</record>
<!-- Inherits kanban view of project.task: t-att-style is added to specify the color of note -->
<record id="project_task_view_todo_kanban" model="ir.ui.view">
<field name="name">project.task.view.kanban.inherit.magic.note</field>
<field name="model">project.task</field>
<field name="inherit_id"
ref="project_todo.project_task_view_todo_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="replace">
<kanban default_group_by="personal_stage_type_id"
class="o_kanban_small_column"
on_create="quick_create"
quick_create_view="project_todo.project_task_view_todo_quick_create_form"
sample="1"
js_class="project_task_kanban"
default_order="state, priority desc, date_deadline asc, sequence, id desc">
<field name="color"/>
<field name="sequence"/>
<field name="name"/>
<field name="active"/>
<field name="description"/>
<field name="message_partner_ids"/>
<field name="activity_ids"/>
<field name="activity_state"/>
<field name="state"/>
<field name="note_color"/>
<progressbar field="activity_state"
colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-menu">
<a role="menuitem" type="delete"
class="dropdown-item">Delete
</a>
<ul class="oe_kanban_colorpicker"
data-field="color"/>
</t>
<t t-name="kanban-box">
<t t-set="todoHasAssignees"
t-value="record.user_ids.raw_value.length &gt; 1"/>
<div t-attf-class="#{kanban_color(record.color.raw_value)} oe_kanban_global_click_edit oe_semantic_html_override oe_kanban_card"
t-attf-style="background-color: #{record.note_color.raw_value};">
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<div class="d-flex justify-content-start">
<div>
<field name="state"
widget="todo_done_checkmark"
options="{'hide_label': 1}"/>
</div>
<div t-att-class="['1_done', '1_canceled'].includes(record.state.raw_value) ? 'opacity-50' : ''">
<strong class="o_kanban_record_title align-middle">
<field name="name"
widget="name_with_subtask_count"/>
</strong>
</div>
</div>
</div>
</div>
<div class="o_kanban_record_body o_todo_kanban_card_body"
t-att-class="['1_done', '1_canceled'].includes(record.state.raw_value) ? 'opacity-50' : ''">
<field name="tag_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"/>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left"/>
<div class="oe_kanban_bottom_right"
t-att-class="['1_done', '1_canceled'].includes(record.state.raw_value) ? 'opacity-50' : ''">
<div t-attf-class="d-flex #{todoHasAssignees ? 'w-100 align-items-center justify-content-end' : 'align-items-end'}">
<div class="d-flex align-items-center me-2 mt-2">
<div t-if="todoHasAssignees">
<field name="user_ids"
widget="many2many_avatar_user"/>
</div>
<field name="activity_ids"
widget="kanban_activity"/>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</xpath>
</field>
</record>
</odoo>