Skip to content

Commit 32b89c6

Browse files
committed
[MIG] project_task_report: Migration to 18.0
1 parent 76e02df commit 32b89c6

File tree

4 files changed

+119
-150
lines changed

4 files changed

+119
-150
lines changed

project_task_report/__manifest__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
{
66
"name": "Project Task Report",
77
"summary": "Basic report for project tasks.",
8-
"version": "16.0.1.0.0",
8+
"version": "18.0.1.0.0",
99
"author": "Eficent, Odoo Community Association (OCA)",
1010
"website": "https://github.com/OCA/project-reporting",
1111
"category": "Project Management",
1212
"depends": ["project"],
13-
"data": ["views/project_task_report.xml", "views/project_task_chatter_report.xml"],
13+
"data": [
14+
"views/project_task_document.xml",
15+
"views/project_task_report.xml",
16+
"views/project_task_chatter_report.xml",
17+
],
1418
"license": "AGPL-3",
1519
"installable": True,
1620
"application": False,

project_task_report/views/project_task_chatter_report.xml

Lines changed: 31 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -7,102 +7,47 @@
77
<t t-foreach="docs" t-as="o">
88
<t t-call="web.external_layout">
99
<div class="page">
10-
<br />
11-
<br />
12-
<center>
13-
<h2><span
14-
t-esc="o.project_id and o.project_id.label_tasks or 'Task'"
15-
/>: <span t-field="o.name" /></h2>
16-
</center>
17-
<table class="table table-bordered">
18-
<tr>
19-
<th>Project</th>
20-
<td>
21-
<span t-field="o.project_id.name" />
22-
</td>
23-
</tr>
24-
<tr>
25-
<th>Assigned to</th>
26-
<td>
27-
<span
28-
t-esc="', '.join(o.user_ids.mapped('name'))"
29-
/>
30-
</td>
31-
</tr>
32-
<tr t-if="o.date_deadline">
33-
<th>Deadline</th>
34-
<td>
35-
<span t-esc="o.date_deadline" />
36-
</td>
37-
</tr>
38-
<tr t-if="o.date_assign">
39-
<th>Assigning Date</th>
40-
<td>
41-
<span t-esc="o.date_assign" />
42-
</td>
43-
</tr>
44-
<tr t-if="o.date_last_stage_update">
45-
<th>Last Stage Update</th>
46-
<td>
47-
<span t-field="o.date_last_stage_update" />
48-
</td>
49-
</tr>
50-
<tr t-if="o.partner_id">
51-
<th>Partner</th>
52-
<td>
53-
<span t-field="o.partner_id" />
54-
</td>
55-
</tr>
56-
<tr t-if="o.tag_ids">
57-
<th>Tags</th>
58-
<td>
59-
<span>| </span>
60-
<t t-foreach="o.tag_ids" t-as="tag">
61-
<span t-field="tag.name" />
62-
<span>| </span>
63-
</t>
64-
</td>
65-
</tr>
66-
</table>
67-
<t t-if="o.description">
68-
<center>
69-
<h3>Description</h3>
70-
</center>
71-
<span t-field="o.description" />
72-
<hr />
73-
</t>
74-
<center>
75-
<h3>Chatter</h3>
76-
</center>
10+
<t t-call="project_task_report.task_report_document" />
11+
12+
<h3 class="text-center">Chatter</h3>
7713
<table>
7814
<t t-foreach="o.message_ids" t-as="msg">
7915
<tr>
80-
<td style="padding-right: 1cm; font-weight:bold;">
81-
<span t-field="msg.author_id" />
82-
<br />
83-
<div style="font-size:75%; padding-left: 3mm;">
16+
<td class="fw-bold">
17+
<p class="m-2 mb-0" t-field="msg.author_id" />
18+
<small class="ps-3">
8419
(<span t-field="msg.date" />)
85-
</div>
20+
</small>
8621
</td>
8722
<td>
88-
<div t-if="msg.subject"><span
89-
t-field="msg.subject"
90-
/>: </div>
91-
<div t-if="msg.message_type == 'notification'">
92-
<span t-field="msg.subtype_id.name" />
23+
<t t-if="msg.subject">
24+
<span
25+
class="m-2 me-0"
26+
t-esc="msg.subject"
27+
/>:
28+
</t>
29+
<t t-if="msg.message_type == 'notification'">
30+
<p
31+
class="m-2 mb-0"
32+
t-field="msg.subtype_id.name"
33+
/>
9334
<t
94-
t-foreach='msg.sudo().tracking_value_ids'
95-
t-as='value'
35+
t-foreach="msg.sudo().tracking_value_ids"
36+
t-as="value"
9637
>
97-
<li>
98-
<t t-esc="value.field_desc" />:
99-
<span>
100-
<t t-esc="value.new_value_char" />
101-
</span>
38+
<li class="ps-3">
39+
<span
40+
t-esc="value.field_id.field_description"
41+
/>:
42+
<span
43+
t-esc="value.new_value_char"
44+
/>
10245
</li>
10346
</t>
47+
</t>
48+
<div class="ps-3">
49+
<span t-field="msg.body" />
10450
</div>
105-
<span t-field="msg.body" />
10651
</td>
10752
</tr>
10853
</t>
@@ -112,6 +57,7 @@
11257
</t>
11358
</t>
11459
</template>
60+
11561
<record id="report_project_task_chatter_action" model="ir.actions.report">
11662
<field name="name">Print Task and Chatter</field>
11763
<field name="model">project.task</field>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
3+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
4+
<odoo>
5+
<template id="task_report_document">
6+
<h2 class="mt-5 pt-5 text-center">
7+
<span t-esc="o.project_id and o.project_id.label_tasks or 'Task'" />:
8+
<span t-field="o.name" />
9+
</h2>
10+
11+
<table class="table table-bordered">
12+
<tr>
13+
<th>
14+
<strong class="m-2">Project</strong>
15+
</th>
16+
<td>
17+
<span t-field="o.project_id.name" />
18+
</td>
19+
</tr>
20+
<tr>
21+
<th>
22+
<strong class="m-2">Assigned to</strong>
23+
</th>
24+
<td>
25+
<span t-esc="', '.join(o.user_ids.mapped('name'))" />
26+
</td>
27+
</tr>
28+
<tr t-if="o.date_deadline">
29+
<th>
30+
<strong class="m-2">Deadline</strong>
31+
</th>
32+
<td>
33+
<span t-field="o.date_deadline" />
34+
</td>
35+
</tr>
36+
<tr t-if="o.date_assign">
37+
<th>
38+
<strong class="m-2">Assigning Date</strong>
39+
</th>
40+
<td>
41+
<span t-field="o.date_assign" />
42+
</td>
43+
</tr>
44+
<tr t-if="o.date_last_stage_update">
45+
<th>
46+
<strong class="m-2">Last Stage Update</strong>
47+
</th>
48+
<td>
49+
<span t-field="o.date_last_stage_update" />
50+
</td>
51+
</tr>
52+
<tr t-if="o.partner_id">
53+
<th>
54+
<strong class="m-2">Partner</strong>
55+
</th>
56+
<td>
57+
<span t-field="o.partner_id" />
58+
</td>
59+
</tr>
60+
<tr t-if="o.tag_ids">
61+
<th>
62+
<strong class="m-2">Tags</strong>
63+
</th>
64+
<td>
65+
<span>| </span>
66+
<t t-foreach="o.tag_ids" t-as="tag">
67+
<span t-field="tag.name" />
68+
<span>| </span>
69+
</t>
70+
</td>
71+
</tr>
72+
</table>
73+
74+
<t t-if="o.description">
75+
<h3 class="text-center">Description</h3>
76+
<span t-field="o.description" />
77+
<hr />
78+
</t>
79+
</template>
80+
</odoo>

project_task_report/views/project_task_report.xml

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,74 +7,13 @@
77
<t t-foreach="docs" t-as="o">
88
<t t-call="web.external_layout">
99
<div class="page">
10-
<br />
11-
<br />
12-
<center>
13-
<h2><span
14-
t-esc="o.project_id and o.project_id.label_tasks or 'Task'"
15-
/>: <span t-field="o.name" /></h2>
16-
</center>
17-
<table class="table table-bordered">
18-
<tr>
19-
<th>Project</th>
20-
<td>
21-
<span t-field="o.project_id.name" />
22-
</td>
23-
</tr>
24-
<tr>
25-
<th>Assigned to</th>
26-
<td>
27-
<span
28-
t-esc="', '.join(o.user_ids.mapped('name'))"
29-
/>
30-
</td>
31-
</tr>
32-
<tr t-if="o.date_deadline">
33-
<th>Deadline</th>
34-
<td>
35-
<span t-esc="o.date_deadline" />
36-
</td>
37-
</tr>
38-
<tr t-if="o.date_assign">
39-
<th>Assigning Date</th>
40-
<td>
41-
<span t-esc="o.date_assign" />
42-
</td>
43-
</tr>
44-
<tr t-if="o.date_last_stage_update">
45-
<th>Last Stage Update</th>
46-
<td>
47-
<span t-field="o.date_last_stage_update" />
48-
</td>
49-
</tr>
50-
<tr t-if="o.partner_id">
51-
<th>Partner</th>
52-
<td>
53-
<span t-field="o.partner_id" />
54-
</td>
55-
</tr>
56-
<tr t-if="o.tag_ids">
57-
<th>Tags</th>
58-
<td>
59-
<span>| </span>
60-
<t t-foreach="o.tag_ids" t-as="tag">
61-
<span t-field="tag.name" />
62-
<span>| </span>
63-
</t>
64-
</td>
65-
</tr>
66-
</table>
67-
<t t-if="o.description">
68-
<center>
69-
<h3>Description</h3>
70-
</center>
71-
<span t-field="o.description" />
72-
</t>
10+
<t t-call="project_task_report.task_report_document" />
7311
</div>
7412
</t>
7513
</t>
7614
</t>
7715
</template>
16+
7817
<record id="report_project_task_action" model="ir.actions.report">
7918
<field name="name">Print Task</field>
8019
<field name="model">project.task</field>

0 commit comments

Comments
 (0)