Skip to content

Commit

Permalink
[IMP] sale_timesheet_timeline: Add table to order portal view
Browse files Browse the repository at this point in the history
TT50569
  • Loading branch information
pilarvargas-tecnativa committed Aug 21, 2024
1 parent 44804da commit f05b170
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 6 deletions.
3 changes: 3 additions & 0 deletions sale_timesheet_timeline/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ when confirming the order.

It includes a timeline view for pre-viewing and managing the planning.

In addition this planning can be consulted in the order view from the portal.

**Table of contents**

.. contents::
Expand All @@ -50,6 +52,7 @@ Usage
"Task Start", "Task End" and "Task Assignees".
#. You can also click on the "Planning" button and plan the dates visually in the
timeline view.
#. Finally, when the order is confirmed, if this planning has been established, it can be viewed from the portal in the planning section.

Bug Tracker
===========
Expand Down
2 changes: 1 addition & 1 deletion sale_timesheet_timeline/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"installable": True,
"application": False,
"depends": ["sale_timesheet", "project_timeline"],
"data": ["views/sale_order_views.xml"],
"data": ["views/sale_order_views.xml", "views/sale_portal_templates.xml"],
}
33 changes: 30 additions & 3 deletions sale_timesheet_timeline/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-20 19:48+0000\n"
"PO-Revision-Date: 2024-08-20 19:48+0000\n"
"POT-Creation-Date: 2024-08-21 07:09+0000\n"
"PO-Revision-Date: 2024-08-21 09:11+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.view_order_form
Expand All @@ -25,6 +27,21 @@ msgstr "<span class=\"o_stat_text\">Planificación</span>"
msgid "Any Service Line"
msgstr "Cualquier línea de servicio"

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Assignees"
msgstr "Asignados"

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "End"
msgstr "Fin"

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Planning"
msgstr "Planificación"

#. module: sale_timesheet_timeline
#: model:ir.model,name:sale_timesheet_timeline.model_sale_order
msgid "Sales Order"
Expand All @@ -40,6 +57,16 @@ msgstr "Línea de pedido de venta"
msgid "Sales Tasks Planning"
msgstr "Planificación de tareas de ventas"

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Start"
msgstr "Inicio"

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Task"
msgstr "Tarea"

#. module: sale_timesheet_timeline
#: model:ir.model.fields,field_description:sale_timesheet_timeline.field_sale_order_line__task_user_ids
msgid "Task Assignees"
Expand Down
29 changes: 27 additions & 2 deletions sale_timesheet_timeline/i18n/sale_timesheet_timeline.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-20 19:48+0000\n"
"PO-Revision-Date: 2024-08-20 19:48+0000\n"
"POT-Creation-Date: 2024-08-21 07:09+0000\n"
"PO-Revision-Date: 2024-08-21 07:09+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -25,6 +25,21 @@ msgstr ""
msgid "Any Service Line"
msgstr ""

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Assignees"
msgstr ""

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "End"
msgstr ""

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Planning"
msgstr ""

#. module: sale_timesheet_timeline
#: model:ir.model,name:sale_timesheet_timeline.model_sale_order
msgid "Sales Order"
Expand All @@ -40,6 +55,16 @@ msgstr ""
msgid "Sales Tasks Planning"
msgstr ""

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Start"
msgstr ""

#. module: sale_timesheet_timeline
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
msgid "Task"
msgstr ""

#. module: sale_timesheet_timeline
#: model:ir.model.fields,field_description:sale_timesheet_timeline.field_sale_order_line__task_user_ids
msgid "Task Assignees"
Expand Down
2 changes: 2 additions & 0 deletions sale_timesheet_timeline/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ order lines that are services, and they are transferred to the created task (if
when confirming the order.

It includes a timeline view for pre-viewing and managing the planning.

In addition this planning can be consulted in the order view from the portal.
1 change: 1 addition & 0 deletions sale_timesheet_timeline/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
"Task Start", "Task End" and "Task Assignees".
#. You can also click on the "Planning" button and plan the dates visually in the
timeline view.
#. Finally, when the order is confirmed, if this planning has been established, it can be viewed from the portal in the planning section.
2 changes: 2 additions & 0 deletions sale_timesheet_timeline/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ <h1 class="title">Dates planning in sales order lines</h1>
order lines that are services, and they are transferred to the created task (if any)
when confirming the order.</p>
<p>It includes a timeline view for pre-viewing and managing the planning.</p>
<p>In addition this planning can be consulted in the order view from the portal.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -397,6 +398,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
“Task Start”, “Task End” and “Task Assignees”.</li>
<li>You can also click on the “Planning” button and plan the dates visually in the
timeline view.</li>
<li>Finally, when the order is confirmed, if this planning has been established, it can be viewed from the portal in the planning section.</li>
</ol>
</div>
<div class="section" id="bug-tracker">
Expand Down
67 changes: 67 additions & 0 deletions sale_timesheet_timeline/views/sale_portal_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<odoo>
<template
id="sale_order_portal_content"
inherit_id="sale.sale_order_portal_content"
>
<xpath expr="//div[@id='total']" position="after">
<t
t-set="show_timeline"
t-value="lines_to_report.filtered(lambda x: x.task_date_start or x.task_date_end or x.task_user_ids)"
/>
<div t-if="show_timeline" id="timeline">
<h3>Planning</h3>
<table
t-att-data-order-id="sale_order.id"
t-att-data-token="sale_order.access_token"
class="table table-sm"
id="sales_order_table"
>
<thead class="bg-100">
<tr>
<th class="text-start" id="product_name_header">Task</th>
<th class="text-end">Start</th>
<th class="text-end">End</th>
<th class="text-end">Assignees</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-foreach="lines_to_report" t-as="line">
<t
t-set="show_line"
t-value="line.task_date_start or line.task_date_end or line.task_user_ids"
/>
<tr
t-if="show_line"
t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''"
>
<t t-if="not line.display_type">
<t t-set="name" t-value="line.name.split('\n')" />
<td id="name">
<span
t-esc="name[0] + ' ' + name[1] if len(name) > 1 else name[0]"
/>
</td>
<td class="text-end">
<div id="date_start">
<span t-field="line.task_date_start" />
</div>
</td>
<td class="text-end">
<div id="date_end">
<span t-field="line.task_date_end" />
</div>
</td>
<td class="text-end">
<div id="user_ids">
<span t-field="line.task_user_ids" />
</div>
</td>
</t>
</tr>
</t>
</tbody>
</table>
</div>
</xpath>
</template>
</odoo>

0 comments on commit f05b170

Please sign in to comment.