Skip to content

Commit eb71e77

Browse files
[IMP] sale_timesheet_timeline: Add table to order portal view
TT50569
1 parent 44804da commit eb71e77

File tree

8 files changed

+138
-6
lines changed

8 files changed

+138
-6
lines changed

sale_timesheet_timeline/README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ when confirming the order.
3434

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

37+
In addition this planning can be consulted in the order view from the portal.
38+
3739
**Table of contents**
3840

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

5457
Bug Tracker
5558
===========

sale_timesheet_timeline/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"installable": True,
1212
"application": False,
1313
"depends": ["sale_timesheet", "project_timeline"],
14-
"data": ["views/sale_order_views.xml"],
14+
"data": ["views/sale_order_views.xml", "views/sale_portal_templates.xml"],
1515
}

sale_timesheet_timeline/i18n/es.po

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Odoo Server 16.0\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2024-08-20 19:48+0000\n"
10-
"PO-Revision-Date: 2024-08-20 19:48+0000\n"
9+
"POT-Creation-Date: 2024-08-21 07:09+0000\n"
10+
"PO-Revision-Date: 2024-08-21 09:11+0200\n"
1111
"Last-Translator: \n"
1212
"Language-Team: \n"
13+
"Language: es\n"
1314
"MIME-Version: 1.0\n"
1415
"Content-Type: text/plain; charset=UTF-8\n"
15-
"Content-Transfer-Encoding: \n"
16+
"Content-Transfer-Encoding: 8bit\n"
1617
"Plural-Forms: \n"
18+
"X-Generator: Poedit 3.0.1\n"
1719

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

30+
#. module: sale_timesheet_timeline
31+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
32+
msgid "Assignees"
33+
msgstr "Asignados"
34+
35+
#. module: sale_timesheet_timeline
36+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
37+
msgid "End"
38+
msgstr "Fin"
39+
40+
#. module: sale_timesheet_timeline
41+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
42+
msgid "Planning"
43+
msgstr "Planificación"
44+
2845
#. module: sale_timesheet_timeline
2946
#: model:ir.model,name:sale_timesheet_timeline.model_sale_order
3047
msgid "Sales Order"
@@ -40,6 +57,16 @@ msgstr "Línea de pedido de venta"
4057
msgid "Sales Tasks Planning"
4158
msgstr "Planificación de tareas de ventas"
4259

60+
#. module: sale_timesheet_timeline
61+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
62+
msgid "Start"
63+
msgstr "Inicio"
64+
65+
#. module: sale_timesheet_timeline
66+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
67+
msgid "Task"
68+
msgstr "Tarea"
69+
4370
#. module: sale_timesheet_timeline
4471
#: model:ir.model.fields,field_description:sale_timesheet_timeline.field_sale_order_line__task_user_ids
4572
msgid "Task Assignees"

sale_timesheet_timeline/i18n/sale_timesheet_timeline.pot

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Odoo Server 16.0\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2024-08-20 19:48+0000\n"
10-
"PO-Revision-Date: 2024-08-20 19:48+0000\n"
9+
"POT-Creation-Date: 2024-08-21 07:09+0000\n"
10+
"PO-Revision-Date: 2024-08-21 07:09+0000\n"
1111
"Last-Translator: \n"
1212
"Language-Team: \n"
1313
"MIME-Version: 1.0\n"
@@ -25,6 +25,21 @@ msgstr ""
2525
msgid "Any Service Line"
2626
msgstr ""
2727

28+
#. module: sale_timesheet_timeline
29+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
30+
msgid "Assignees"
31+
msgstr ""
32+
33+
#. module: sale_timesheet_timeline
34+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
35+
msgid "End"
36+
msgstr ""
37+
38+
#. module: sale_timesheet_timeline
39+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
40+
msgid "Planning"
41+
msgstr ""
42+
2843
#. module: sale_timesheet_timeline
2944
#: model:ir.model,name:sale_timesheet_timeline.model_sale_order
3045
msgid "Sales Order"
@@ -40,6 +55,16 @@ msgstr ""
4055
msgid "Sales Tasks Planning"
4156
msgstr ""
4257

58+
#. module: sale_timesheet_timeline
59+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
60+
msgid "Start"
61+
msgstr ""
62+
63+
#. module: sale_timesheet_timeline
64+
#: model_terms:ir.ui.view,arch_db:sale_timesheet_timeline.sale_order_portal_content
65+
msgid "Task"
66+
msgstr ""
67+
4368
#. module: sale_timesheet_timeline
4469
#: model:ir.model.fields,field_description:sale_timesheet_timeline.field_sale_order_line__task_user_ids
4570
msgid "Task Assignees"

sale_timesheet_timeline/readme/DESCRIPTION.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ order lines that are services, and they are transferred to the created task (if
33
when confirming the order.
44

55
It includes a timeline view for pre-viewing and managing the planning.
6+
7+
In addition this planning can be consulted in the order view from the portal.

sale_timesheet_timeline/readme/USAGE.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
"Task Start", "Task End" and "Task Assignees".
77
#. You can also click on the "Planning" button and plan the dates visually in the
88
timeline view.
9+
#. Finally, when the order is confirmed, if this planning has been established, it can be viewed from the portal in the planning section.

sale_timesheet_timeline/static/description/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ <h1 class="title">Dates planning in sales order lines</h1>
373373
order lines that are services, and they are transferred to the created task (if any)
374374
when confirming the order.</p>
375375
<p>It includes a timeline view for pre-viewing and managing the planning.</p>
376+
<p>In addition this planning can be consulted in the order view from the portal.</p>
376377
<p><strong>Table of contents</strong></p>
377378
<div class="contents local topic" id="contents">
378379
<ul class="simple">
@@ -397,6 +398,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
397398
“Task Start”, “Task End” and “Task Assignees”.</li>
398399
<li>You can also click on the “Planning” button and plan the dates visually in the
399400
timeline view.</li>
401+
<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>
400402
</ol>
401403
</div>
402404
<div class="section" id="bug-tracker">
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<odoo>
2+
<template
3+
id="sale_order_portal_content"
4+
inherit_id="sale.sale_order_portal_content"
5+
>
6+
<xpath expr="//div[@id='total']" position="after">
7+
<t
8+
t-set="show_timeline"
9+
t-value="lines_to_report.filtered(lambda x: x.task_date_start or x.task_date_end or x.task_user_ids)"
10+
/>
11+
<div t-if="show_timeline" id="timeline">
12+
<h3>Planning</h3>
13+
<table class="table table-sm" id="sales_order_planning_table">
14+
<thead class="bg-100">
15+
<tr>
16+
<th class="text-start" id="product_name_header">Task</th>
17+
<th class="text-center">Start</th>
18+
<th class="text-center">End</th>
19+
<th class="text-end">Assignees</th>
20+
</tr>
21+
</thead>
22+
<tbody class="sale_tbody">
23+
<t
24+
t-set="sorted_lines"
25+
t-value="sorted(lines_to_report, key=lambda l: (l.task_date_start is False and l.task_date_end is False, l.task_date_start is not False, l.task_date_start or l.task_date_end))"
26+
/>
27+
<t t-foreach="sorted_lines" t-as="line">
28+
<t
29+
t-set="show_line"
30+
t-value="line.task_date_start or line.task_date_end or line.task_user_ids"
31+
/>
32+
<tr
33+
t-if="show_line"
34+
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 ''"
35+
>
36+
<t t-if="not line.display_type">
37+
<t t-set="name" t-value="line.name.split('\n')" />
38+
<td id="name">
39+
<span
40+
t-esc="name[0] + ' ' + name[1] if len(name) > 1 else name[0]"
41+
/>
42+
</td>
43+
<td class="text-center">
44+
<div id="date_start">
45+
<span
46+
t-field="line.task_date_start"
47+
t-options='{"widget": "date"}'
48+
/>
49+
</div>
50+
</td>
51+
<td class="text-center">
52+
<div id="date_end">
53+
<span
54+
t-field="line.task_date_end"
55+
t-options='{"widget": "date"}'
56+
/>
57+
</div>
58+
</td>
59+
<td class="text-end">
60+
<div id="user_ids">
61+
<span t-field="line.task_user_ids" />
62+
</div>
63+
</td>
64+
</t>
65+
</tr>
66+
</t>
67+
</tbody>
68+
</table>
69+
</div>
70+
</xpath>
71+
</template>
72+
</odoo>

0 commit comments

Comments
 (0)