[IMP] sale_timesheet: move View Timesheets button in portal invoice

Before this commit, we show the button in the invoice page.

This commit moves this button in the sidebar (left panel).

task-2424382
This commit is contained in:
Xavier BOL (xbo)
2021-01-15 15:59:59 +01:00
parent 5589154c3a
commit 82a0422df5
3 changed files with 13 additions and 11 deletions
-1
View File
@@ -25,7 +25,6 @@ have real delivered quantities in sales orders.
'views/hr_timesheet_views.xml',
'views/res_config_settings_views.xml',
'views/hr_timesheet_templates.xml',
'views/report_invoice.xml',
'views/sale_timesheet_portal_templates.xml',
'report/project_profitability_report_analysis_views.xml',
'data/sale_timesheet_filters.xml',
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//div[hasclass('page')]/h2" position="after">
<a t-if="report_type == 'html' and o.move_type == 'out_invoice' and o.state in ('draft', 'posted') and o.timesheet_count > 0" target="_blank" t-att-href="'/my/timesheets?search_in=invoice&amp;search=%s' % o.name">View Timesheets</a>
</xpath>
</template>
</data>
</odoo>
@@ -44,4 +44,17 @@
</xpath>
</template>
<template id="portal_invoice_page_inherit" inherit_id="account.portal_invoice_page">
<xpath expr="//t[@t-set='entries']/ul/li[.//a[@id='print_invoice_report']]" position="after">
<li class="list-group-item flex-grow-1">
<div class="btn-toolbar flex-sm-nowrap justify-content-center">
<div class="btn-group mb-1">
<a t-if="invoice.move_type == 'out_invoice' and invoice.state in ('draft', 'posted') and invoice.timesheet_count > 0"
target="_blank" t-att-href="'/my/timesheets?search_in=invoice&amp;search=%s' % invoice.name">View Timesheets</a>
</div>
</div>
</li>
</xpath>
</template>
</odoo>