Skip to content

Commit 914d152

Browse files
[MIG] hr_timesheet_begin_end: Migration to 17.0
1 parent ed71a52 commit 914d152

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

hr_timesheet_begin_end/README.rst

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Contributors
6868
- Andrea Stirpe
6969

7070
- Sunanda Chhatbar <sunanda.chhatbar@initos.com>
71+
- Nils Coenen <nils.coenen@nico-solutions.de>
7172

7273
Maintainers
7374
-----------

hr_timesheet_begin_end/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{
66
"name": "Timesheet - Begin/End Hours",
7-
"version": "16.0.1.0.0",
7+
"version": "17.0.1.0.0",
88
"author": "Camptocamp, Tecnativa, Odoo Community Association (OCA)",
99
"license": "AGPL-3",
1010
"category": "Human Resources",

hr_timesheet_begin_end/models/account_analytic_line.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ def _check_time_start_stop(self):
6464
message = _("Lines can't overlap:\n")
6565
message += "\n".join(
6666
[
67-
"%s - %s"
68-
% (
67+
"{} - {}".format(
6968
value_to_html(other.time_start, None),
7069
value_to_html(other.time_stop, None),
7170
)
72-
for other in (line + others).sorted(lambda l: l.time_start)
71+
for other in (line + others).sorted(
72+
key=lambda item: item.time_start
73+
)
7374
]
7475
)
7576
raise exceptions.ValidationError(message)
@@ -84,7 +85,7 @@ def onchange_hours_start_stop(self):
8485

8586
def merge_timesheets(self): # pragma: no cover
8687
"""This method is needed in case hr_timesheet_sheet is installed"""
87-
lines = self.filtered(lambda l: not l.time_start and not l.time_stop)
88+
lines = self.filtered(lambda line: not line.time_start and not line.time_stop)
8889
if lines:
8990
return super(AccountAnalyticLine, lines).merge_timesheets()
9091
return self[0]

hr_timesheet_begin_end/readme/CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
- [Onestein](https://www.onestein.eu):
66
- Andrea Stirpe
77
- Sunanda Chhatbar \<<sunanda.chhatbar@initos.com>\>
8+
- Nils Coenen \<<nils.coenen@nico-solutions.de>\>

hr_timesheet_begin_end/static/description/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
414414
</ul>
415415
</li>
416416
<li>Sunanda Chhatbar &lt;<a class="reference external" href="mailto:sunanda.chhatbar&#64;initos.com">sunanda.chhatbar&#64;initos.com</a>&gt;</li>
417+
<li>Nils Coenen &lt;<a class="reference external" href="mailto:nils.coenen&#64;nico-solutions.de">nils.coenen&#64;nico-solutions.de</a>&gt;</li>
417418
</ul>
418419
</div>
419420
<div class="section" id="maintainers">

hr_timesheet_begin_end/tests/test_timesheet_begin_end.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@
66

77

88
class TestBeginEnd(common.TransactionCase):
9-
def setUp(self):
10-
super(TestBeginEnd, self).setUp()
11-
self.timesheet_line_model = self.env["account.analytic.line"]
12-
self.analytic = self.env.ref("analytic.analytic_administratif")
13-
self.user = self.env.ref("base.user_root")
14-
self.base_line = {
9+
@classmethod
10+
def setUpClass(cls):
11+
super().setUpClass()
12+
cls.timesheet_line_model = cls.env["account.analytic.line"]
13+
cls.analytic = cls.env.ref("analytic.analytic_administratif")
14+
cls.user = cls.env.ref("base.user_root")
15+
cls.base_line = {
1516
"name": "test",
1617
"date": fields.Date.today(),
1718
"time_start": 10.0,
1819
"time_stop": 12.0,
19-
"user_id": self.user.id,
20+
"user_id": cls.user.id,
2021
"unit_amount": 2.0,
21-
"account_id": self.analytic.id,
22+
"account_id": cls.analytic.id,
2223
"amount": -60.0,
2324
}
2425

0 commit comments

Comments
 (0)