summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier BOL (xbo) <xbo@odoo.com>2020-12-10 19:52:25 +0100
committerXavier BOL (xbo) <xbo@odoo.com>2020-12-21 15:35:20 +0100
commit782fbd8075d82393c1a33cc52f34006a9fb340a8 (patch)
tree0e1668110d48262294a5050d36731fb63f84ae02
parenta41df84a83380dded4cb8c9d83444f916b9e004d (diff)
[IMP] sale_timesheet: remove timesheets table in SO portal
This view can be too long for the user and we don't give the total of the timesheets and also the SOL linked of these timesheets. This view is replaced by a button called 'View Timesheets' next the name of the product and this button redirects the user to the /my/timesheets page with a filter on the corresponding SOL. task-2409761
-rw-r--r--addons/sale_timesheet/views/sale_timesheet_portal_templates.xml89
1 files changed, 47 insertions, 42 deletions
diff --git a/addons/sale_timesheet/views/sale_timesheet_portal_templates.xml b/addons/sale_timesheet/views/sale_timesheet_portal_templates.xml
index 2f9ae255141..e26913ecec2 100644
--- a/addons/sale_timesheet/views/sale_timesheet_portal_templates.xml
+++ b/addons/sale_timesheet/views/sale_timesheet_portal_templates.xml
@@ -31,7 +31,7 @@
<table class="table table-sm">
<thead>
<tr>
- <th>Date</th>
+ <th>Date</th>
<th>Employee</th>
<th t-if="nr_projects &gt; 1">Project</th>
<th t-if="nr_tasks &gt; 0">Task</th>
@@ -65,55 +65,60 @@
</xpath>
</template>
+ <!-- TODO: [XBO] Remove me in master -->
<template id="sale_order_portal_template_inherit" inherit_id="sale.sale_order_portal_template">
<xpath expr="//t[@t-call='portal.portal_record_sidebar']//div[hasclass('o_download_pdf')]" position="after">
- <li t-if="timesheets" class="list-group-item flex-grow-1" >
- <a href="#accordion">Timesheets</a>
- </li>
+ <t t-if="1 == 0">
+ <li t-if="timesheets" class="list-group-item flex-grow-1" >
+ <a href="#accordion">Timesheets</a>
+ </li>
+ </t>
</xpath>
<xpath expr="//div[@id='sale_order_communication']" position="before">
- <div t-if="timesheets" class="container">
- <div id="accordion" class="o_timesheet_accordion mt-4">
- <div class="card mb-0">
- <div class="card-header">
- <h5 class="mb0">
- <a class="card-title" data-toggle="collapse" href="#collapseTimesheet">
- Timesheets
- </a>
- </h5>
- </div>
- <div id="collapseTimesheet" class="card-body show" data-parent="#accordion">
- <t t-set="nr_tasks" t-value="len(timesheets.mapped('task_id'))"/>
- <t t-set="nr_projects" t-value="len(timesheets.mapped('project_id'))"/>
- <table class="table table-sm">
- <thead>
- <tr>
- <th>Date</th>
- <th>Employee</th>
- <th t-if="nr_projects &gt; 1">Project</th>
- <th t-if="nr_tasks &gt; 0">Task</th>
- <th>Description</th>
- <th t-if="timesheets[0]._is_timesheet_encode_uom_day()" class="text-right">Duration (days)</th>
- <th t-else="" class="text-right">Duration (hours)</th>
- </tr>
- </thead>
- <tr t-foreach="timesheets" t-as="timesheet">
- <td><t t-esc="timesheet.date" t-options='{"widget": "date"}'/></td>
- <td><t t-esc="timesheet.employee_id.name"/></td>
- <td t-if="nr_projects &gt; 1"><span t-field="timesheet.project_id"/></td>
- <td t-if="nr_tasks &gt; 0"><span t-field="timesheet.task_id"/></td>
- <td><t t-esc="timesheet.name"/></td>
- <td class="text-right">
- <span t-if="timesheet._is_timesheet_encode_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-if="1 == 0">
+ <div t-if="timesheets" class="container">
+ <div id="accordion" class="o_timesheet_accordion mt-4">
+ <div class="card mb-0">
+ <div class="card-header">
+ <h5 class="mb0">
+ <a class="card-title" data-toggle="collapse" href="#collapseTimesheet">
+ Timesheets
+ </a>
+ </h5>
+ </div>
+ <div id="collapseTimesheet" class="card-body show" data-parent="#accordion">
+ <t t-set="nr_tasks" t-value="len(timesheets.mapped('task_id'))"/>
+ <t t-set="nr_projects" t-value="len(timesheets.mapped('project_id'))"/>
+ <table class="table table-sm">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Employee</th>
+ <th t-if="nr_projects &gt; 1">Project</th>
+ <th t-if="nr_tasks &gt; 0">Task</th>
+ <th>Description</th>
+ <th t-if="timesheets[0]._is_timesheet_encode_uom_day()" class="text-right">Duration (days)</th>
+ <th t-else="" class="text-right">Duration (hours)</th>
+ </tr>
+ </thead>
+ <tr t-foreach="timesheets" t-as="timesheet">
+ <td><t t-esc="timesheet.date" t-options='{"widget": "date"}'/></td>
+ <td><t t-esc="timesheet.employee_id.name"/></td>
+ <td t-if="nr_projects &gt; 1"><span t-field="timesheet.project_id"/></td>
+ <td t-if="nr_tasks &gt; 0"><span t-field="timesheet.task_id"/></td>
+ <td><t t-esc="timesheet.name"/></td>
+ <td class="text-right">
+ <span t-if="timesheet._is_timesheet_encode_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>
+ </div>
</div>
</div>
</div>
- </div>
+ </t>
</xpath>
</template>