<?xml version="1.0"?>
<data inherit_id="project.portal_tasks_list" name="Portal: My Tasks with Timesheets">
        <xpath expr="//thead" position="before">
            <t t-set="allow_timesheets" t-value="any(task.allow_timesheets for group in grouped_tasks for task in group)"/>
        </xpath>
        <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="after">
            <t t-if="allow_timesheets">
                 <t t-set="number_of_header" t-value="number_of_header + 1"/>
            </t>
        </xpath>
        <xpath expr="//thead/tr/th[@name='project_portal_milestones']" position="after">
            <t t-if="not project or project.allow_timesheets">
                <th class="text-end">Time 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.total_hours_spent)"/>
                        <span t-if="task.allocated_hours &gt; 0"> / <t t-out="timesheet_ids._convert_hours_to_days(task.allocated_hours)"/></span>
                    </t>
                    <t t-else="">
                        <span t-field="task.total_hours_spent" t-options="{&quot;widget&quot;: &quot;float_time&quot;}"/>
                        <t t-if="task.allocated_hours &gt; 0">
                            /
                            <span t-field="task.allocated_hours" t-options="{&quot;widget&quot;: &quot;float_time&quot;}"/>
                        </t>
                    </t>
                </t>
            </td>
        </xpath>
    </data>

