Files
enterprise-addons/project_enterprise/views/project_views.xml
T

77 lines
3.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_project_view_gantt" model="ir.ui.view">
<field name="name">project.project.view.gantt</field>
<field name="model">project.project</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<gantt date_start="date_start"
date_stop="date"
default_scale="month"
scales="week,month,quarter,year"
string="Planning"
display_unavailability="1"
js_class="project_gantt"
precision="{'week': 'day:full', 'month': 'day:full'}"
default_group_by="user_id"
total_row="True"
kanban_view_id="%(project.view_project_kanban)d"
color="stage_id_color">
<templates>
<div t-name="gantt-popover">
<footer replace="0">
<button name="action_view_tasks" type="object" string="View Tasks" class="btn btn-sm btn-secondary"/>
</footer>
</div>
</templates>
<field name="user_id"/>
<field name="partner_id"/>
<field name="stage_id_color" invisible="1"/>
</gantt>
</field>
</record>
<record id="project.open_view_project_all_group_stage" model="ir.actions.act_window">
<field name="view_mode">kanban,list,form,gantt,calendar,activity</field>
</record>
<record id="project.open_view_project_all_config_group_stage" model="ir.actions.act_window">
<field name="view_mode">list,kanban,form,gantt,calendar,activity</field>
</record>
<record id="view_task_kanban_inherited" model="ir.ui.view">
<field name="name">project.enterprise.task.kanban.nonprimary</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class">project_enterprise_task_kanban</attribute>
</xpath>
<field name="date_deadline" position="attributes">
<attribute name="invisible">planned_date_begin or not date_deadline or state in ['1_done', '1_canceled']</attribute>
</field>
<field name="date_deadline" position="after">
<t t-set="cls" t-value="(luxon.DateTime.fromISO(record.date_deadline.raw_value) &lt; luxon.DateTime.local() and !['1_done', '1_canceled'].includes(record.state.raw_value)) ? 'text-danger' : ''"/>
<div invisible="not planned_date_begin" t-attf-class="d-flex align-items-center #{cls}">
<field name="planned_date_begin" widget="daterange" options="{'end_date_field': 'date_deadline'}" class="w-100"/>
</div>
<field name="planning_overlap" class="text-danger o_planning_overlap"
invisible="not context.get('is_form_gantt', False)"/>
</field>
</field>
</record>
<record id="project_templates_view_gantt" model="ir.ui.view">
<field name="name">project.project.template.gantt</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project_enterprise.project_project_view_gantt"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<gantt position="attributes">
<attribute name="js_class"></attribute>
</gantt>
</field>
</record>
</odoo>