74 lines
3.9 KiB
XML
74 lines
3.9 KiB
XML
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
<odoo>
|
||
|
|
||
|
<template id="portal_my_task" inherit_id="project.portal_my_task" name="Portal: My Task with Timesheets">
|
||
|
<xpath expr="//div[@id='task-nav']" position="before">
|
||
|
<div t-if="timesheets and allow_timesheets" class="d-grid flex-grow-1" id='nav-report'>
|
||
|
<div class="o_download_pdf">
|
||
|
<a class="btn btn-secondary o_print_btn o_project_timesheet_print d-block" t-att-href="task.get_portal_url(report_type='pdf')" href="#" title="View Details" target="_blank"><i class="fa fa-print"/> View Details</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
</xpath>
|
||
|
<xpath expr="//li[@id='nav-header']" position="after">
|
||
|
<div t-if="timesheets and allow_timesheets" class="nav-item">
|
||
|
<a class="nav-link p-0" href="#task_timesheets">
|
||
|
Timesheets
|
||
|
</a>
|
||
|
</div>
|
||
|
</xpath>
|
||
|
<xpath expr="//div[@id='card_body']" position="inside">
|
||
|
<div class="container" t-if="timesheets and allow_timesheets">
|
||
|
<h5 id="task_timesheets" class="mt-2 mb-2" data-anchor="true">Timesheets</h5>
|
||
|
<t t-call="hr_timesheet.portal_timesheet_table"/>
|
||
|
</div>
|
||
|
</xpath>
|
||
|
<xpath expr="//div[@name='portal_my_task_allocated_hours']" position="after">
|
||
|
<div t-if="task.allocated_hours > 0 and allow_timesheets"><strong>Progress:</strong> <span t-field="task.progress"/>%</div>
|
||
|
</xpath>
|
||
|
<xpath expr="//div[@name='portal_my_task_allocated_hours']/t" position="replace">
|
||
|
<t t-call="hr_timesheet.portal_my_task_allocated_hours_template"></t>
|
||
|
</xpath>
|
||
|
</template>
|
||
|
|
||
|
<template id="portal_my_task_allocated_hours_template">
|
||
|
<t t-if="is_uom_day and timesheets._convert_hours_to_days(task.allocated_hours) > 0">
|
||
|
<span t-out="timesheets._convert_hours_to_days(task.allocated_hours)" t-options='{"widget": "timesheet_uom"}'/>
|
||
|
</t>
|
||
|
<t t-if="not is_uom_day and task.allocated_hours > 0 and allow_timesheets" t-call="project.portal_my_task_allocated_hours_template"></t>
|
||
|
</template>
|
||
|
|
||
|
<template id="portal_tasks_list_inherit" inherit_id="project.portal_tasks_list" name="Portal: My Tasks with Timesheets">
|
||
|
<xpath expr="//t[@t-foreach='tasks']/tr" position="before">
|
||
|
<t t-set="timesheet_ids" t-value="task.sudo().timesheet_ids"/>
|
||
|
<t t-set="is_uom_day" t-value="timesheet_ids._is_timesheet_encode_uom_day()"/>
|
||
|
</xpath>
|
||
|
<xpath expr="//thead/tr/t[@t-set='number_of_header']" position="attributes">
|
||
|
<attribute name="t-value">9</attribute>
|
||
|
</xpath>
|
||
|
<xpath expr="//thead/tr/th[@name='project_portal_milestones']" position="after">
|
||
|
<t t-if="not project or project.allow_timesheets">
|
||
|
<th t-if="is_uom_day" class="text-end">Days Spent</th>
|
||
|
<th t-else="" class="text-end">Hours Spent</th>
|
||
|
</t>
|
||
|
</xpath>
|
||
|
<xpath expr="//tbody/t/tr/td[@name='project_portal_milestones']" position="after">
|
||
|
<td t-if="not project or project.allow_timesheets" class="text-end">
|
||
|
<t t-if="task.allow_timesheets">
|
||
|
<t t-if="is_uom_day">
|
||
|
<t t-out="timesheet_ids._convert_hours_to_days(task.effective_hours)"/>
|
||
|
<span t-if="task.allocated_hours > 0"> / <t t-out="timesheet_ids._convert_hours_to_days(task.allocated_hours)"/></span>
|
||
|
</t>
|
||
|
<t t-else="">
|
||
|
<span t-field="task.effective_hours" t-options='{"widget": "float_time"}'/>
|
||
|
<t t-if="task.allocated_hours > 0">
|
||
|
/
|
||
|
<span t-field="task.allocated_hours" t-options='{"widget": "float_time"}'/>
|
||
|
</t>
|
||
|
</t>
|
||
|
</t>
|
||
|
</td>
|
||
|
</xpath>
|
||
|
</template>
|
||
|
|
||
|
</odoo>
|