WIP : [IMP] project_working_time_task_portal add subtask timesheets on parent task page #34

Open
maudbuchwalter wants to merge 2 commits from 18.0-project_working_time_task_portal into 18.0
2 changed files with 49 additions and 0 deletions
Showing only changes of commit d63a269de2 - Show all commits

View File

@@ -26,6 +26,7 @@
# views/hr_timesheet_portal.xml",
"views/hr_timesheet_view_task_form2.xml",
"views/portal_tasks_list.xml",
"views/portal_my_task_with_subtasks.xml"
],
"assets": {
"web.assets_frontend": [

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="hr_timesheet_portal_timesheet_table_inherit"
inherit_id="hr_timesheet.portal_timesheet_table">
<xpath expr="//table[hasclass('o_portal_my_doc_table')]" position="after">
<t t-foreach="task.child_ids" t-as="subtask">
<t t-if="subtask.billable_effective_hours > 0">
<a t-attf-href="/my/tasks/#{subtask.id}">
<span t-att-title="subtask.name" t-field="task.name" />
</a>
<t t-set="timesheets" t-value="subtask.timesheet_ids" />
<table class="o_portal_my_doc_table table table-sm table-striped">
<thead>
<tr>
<th>Date</th>
<th>Employee</th>
<th>Description</th>
<th class="text-end" name="t_label">Time Spent</th>
</tr>
</thead>
<tr t-foreach="timesheets" t-as="timesheet" valign="middle">
<td>
<t t-esc="timesheet.date" t-options='{"widget": "date"}' />
</td>
<td t-attf-title="#{timesheet.employee_id.name}">
<t t-esc="timesheet.employee_id.name" />
</td>
<td>
<t t-esc="timesheet.name" />
</td>
<td class="text-end">
<span t-if="is_uom_day" t-esc="timesheet._get_timesheet_time_day()"
t-options='{"widget": "timesheet_uom"}' />
<span t-else="" t-field="timesheet.unit_amount"
t-options='{"widget": "float_time"}' />
</td>
</tr>
</table>
</t>
</t>
</xpath>
</template>
</odoo>