[IMP] sale_timesheet,_*: improve mail template and portal view

_*= account, hr_timesheet
This commit improves the Portal functionality and add email template:

- improve email template for invoice includes timesheet (add link in mail which
  redirect to timesheets linked with invoice).
- improve timesheets template by renaming labels and internal header/footer.

task-3251680

closes odoo/odoo#127224

Related: odoo/enterprise#43593
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
ravb-odoo
2023-10-19 14:47:11 +00:00
parent c44d8d7deb
commit c2fdf83e0b
3 changed files with 10 additions and 6 deletions
@@ -45,6 +45,10 @@
Please use the following communication for your payment: <span style="font-weight:bold;" t-out="object.payment_reference or ''">INV/2021/05/0005</span>.
</t>
</t>
<t t-if="hasattr(object, 'timesheet_count') and object.timesheet_count">
<br /><br />
PS: you can review your timesheets <a t-att-href="'my/timesheets?search_in=invoice&amp;search=%s' % object.name">from the portal.</a>
</t>
<br /><br />
Do not hesitate to contact us if you have any questions.
<t t-if="not is_html_empty(object.invoice_user_id.signature)">
@@ -19,8 +19,8 @@
<th class="text-start align-middle" t-if="timesheet_record_label"><span t-out="timesheet_record_label"/></th>
<th class="text-start align-middle"><span>Description</span></th>
<th class="text-end">
<span t-if="not is_uom_day">Hours Spent</span>
<span t-else="">Days Spent</span>
<span t-if="not is_uom_day">Hours</span>
<span t-else="">Days</span>
</th>
</tr>
</thead>
@@ -73,7 +73,7 @@
<t t-set="title" t-value="docs._description"/>
<t t-set="company" t-value="docs.company_id if len(docs) == 1 else docs.env.company"/>
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-call="web.internal_layout">
<div class="page">
<t t-foreach="docs" t-as="doc">
<t t-if="from_project" t-set="show_task"
@@ -107,7 +107,7 @@
<template id="report_timesheet">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-call="web.internal_layout">
<t t-set="company" t-value="docs.project_id.company_id if len(docs.project_id) == 1 else docs.env.company"/>
<t t-set="show_task" t-value="bool(docs.task_id)"/>
<t t-set="show_project" t-value="len(docs.project_id) > 1"/>
@@ -135,7 +135,7 @@
<!-- Project Task Timesheet Report for given timesheets -->
<template id="report_timesheet_task">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-call="web.internal_layout">
<t t-set="company" t-value="docs.project_id.company_id if len(docs.project_id) == 1 else docs.env.company"/>
<t t-set="show_task" t-value="len(docs.task_id) > 1"/>
<t t-set="show_project" t-value="False"/>
@@ -4,7 +4,7 @@
<t t-set="show_project" t-value="true"/>
<t t-set="show_task" t-value="true"/>
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-call="web.internal_layout">
<div class="page">
<t t-foreach="docs" t-as="doc">
<t t-set="doc_name" t-value="doc.name"/>