Skip to content

Commit beeb3b3

Browse files
[MIG] hr_leave_custom_hour_interval: Migration to 18.0
1 parent d63d614 commit beeb3b3

6 files changed

Lines changed: 71 additions & 9 deletions

File tree

hr_leave_custom_hour_interval/README.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Custom Hour Interval for Holidays
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr--holidays-lightgray.png?logo=github
20-
:target: https://github.com/OCA/hr-holidays/tree/17.0/hr_leave_custom_hour_interval
20+
:target: https://github.com/OCA/hr-holidays/tree/18.0/hr_leave_custom_hour_interval
2121
:alt: OCA/hr-holidays
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/hr-holidays-17-0/hr-holidays-17-0-hr_leave_custom_hour_interval
23+
:target: https://translation.odoo-community.org/projects/hr-holidays-18-0/hr-holidays-18-0-hr_leave_custom_hour_interval
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-holidays&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-holidays&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -52,7 +52,7 @@ Bug Tracker
5252
Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr-holidays/issues>`_.
5353
In case of trouble, please check there if your issue has already been reported.
5454
If you spotted it first, help us to smash it by providing a detailed and welcomed
55-
`feedback <https://github.com/OCA/hr-holidays/issues/new?body=module:%20hr_leave_custom_hour_interval%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
55+
`feedback <https://github.com/OCA/hr-holidays/issues/new?body=module:%20hr_leave_custom_hour_interval%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5656

5757
Do not contact contributors directly about support or help with technical issues.
5858

@@ -76,6 +76,10 @@ Contributors
7676

7777
- Duy Do Anh
7878

79+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
80+
81+
- Bhavesh Heliconia
82+
7983
Maintainers
8084
-----------
8185

@@ -89,6 +93,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8993
mission is to support the collaborative development of Odoo features and
9094
promote its widespread use.
9195

92-
This module is part of the `OCA/hr-holidays <https://github.com/OCA/hr-holidays/tree/17.0/hr_leave_custom_hour_interval>`_ project on GitHub.
96+
This module is part of the `OCA/hr-holidays <https://github.com/OCA/hr-holidays/tree/18.0/hr_leave_custom_hour_interval>`_ project on GitHub.
9397

9498
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

hr_leave_custom_hour_interval/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Custom Hour Interval for Holidays",
66
"summary": """
77
Edit start and end of leaves using time intervals""",
8-
"version": "17.0.1.0.1",
8+
"version": "18.0.1.0.0",
99
"license": "AGPL-3",
1010
"author": "Creu Blanca,Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/hr-holidays",

hr_leave_custom_hour_interval/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
- Enric Tobella
44
- Trobz
55
- Duy Do Anh
6+
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
7+
- Bhavesh Heliconia

hr_leave_custom_hour_interval/static/description/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Custom Hour Interval for Holidays</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:2f7608f6c638938bf513bf7e43557666ec3f4281f68c310dd9fab45bdde7caf9
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/hr-holidays/tree/17.0/hr_leave_custom_hour_interval"><img alt="OCA/hr-holidays" src="https://img.shields.io/badge/github-OCA%2Fhr--holidays-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/hr-holidays-17-0/hr-holidays-17-0-hr_leave_custom_hour_interval"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/hr-holidays&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/hr-holidays/tree/18.0/hr_leave_custom_hour_interval"><img alt="OCA/hr-holidays" src="https://img.shields.io/badge/github-OCA%2Fhr--holidays-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/hr-holidays-18-0/hr-holidays-18-0-hr_leave_custom_hour_interval"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/hr-holidays&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module allows to create time off requests using custom hours with
374374
float fields.</p>
375375
<p><strong>Table of contents</strong></p>
@@ -400,7 +400,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
400400
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/hr-holidays/issues">GitHub Issues</a>.
401401
In case of trouble, please check there if your issue has already been reported.
402402
If you spotted it first, help us to smash it by providing a detailed and welcomed
403-
<a class="reference external" href="https://github.com/OCA/hr-holidays/issues/new?body=module:%20hr_leave_custom_hour_interval%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
403+
<a class="reference external" href="https://github.com/OCA/hr-holidays/issues/new?body=module:%20hr_leave_custom_hour_interval%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
404404
<p>Do not contact contributors directly about support or help with technical issues.</p>
405405
</div>
406406
<div class="section" id="credits">
@@ -423,6 +423,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
423423
<li>Duy Do Anh</li>
424424
</ul>
425425
</li>
426+
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a><ul>
427+
<li>Bhavesh Heliconia</li>
428+
</ul>
429+
</li>
426430
</ul>
427431
</div>
428432
<div class="section" id="maintainers">
@@ -434,7 +438,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
434438
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
435439
mission is to support the collaborative development of Odoo features and
436440
promote its widespread use.</p>
437-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/hr-holidays/tree/17.0/hr_leave_custom_hour_interval">OCA/hr-holidays</a> project on GitHub.</p>
441+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/hr-holidays/tree/18.0/hr_leave_custom_hour_interval">OCA/hr-holidays</a> project on GitHub.</p>
438442
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
439443
</div>
440444
</div>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2021 Creu Blanca
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from . import test_hr_leave_custom_hour_interval
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from datetime import date
2+
3+
from dateutil.relativedelta import relativedelta
4+
5+
from odoo.tests import tagged
6+
7+
from odoo.addons.base.tests.common import BaseCommon
8+
9+
10+
@tagged("post_install", "-at_install")
11+
class TestHRLeaveRequest(BaseCommon):
12+
@classmethod
13+
def setUpClass(cls):
14+
super().setUpClass()
15+
16+
# Create a new employee to avoid conflicts
17+
cls.employee = cls.env["hr.employee"].create(
18+
{
19+
"name": "Test Employee",
20+
"work_email": "test.employee@example.com",
21+
}
22+
)
23+
24+
cls.leave_type = cls.env["hr.leave.type"].create(
25+
{
26+
"name": "Legal Leaves",
27+
"time_type": "leave",
28+
"requires_allocation": "no",
29+
}
30+
)
31+
32+
first_leave_start = date.today() + relativedelta(days=1)
33+
first_leave_end = date.today() + relativedelta(days=2)
34+
35+
cls.first_leave = cls.env["hr.leave"].create(
36+
{
37+
"name": "Christmas",
38+
"employee_id": cls.employee.id,
39+
"holiday_status_id": cls.leave_type.id,
40+
"request_date_from": first_leave_start,
41+
"request_date_to": first_leave_end,
42+
}
43+
)
44+
45+
def test_leave_created_correctly(self):
46+
self.assertEqual(self.first_leave.name, "Christmas")
47+
self.assertEqual(self.first_leave.employee_id.id, self.employee.id)
48+
self.assertEqual(self.first_leave.holiday_status_id.id, self.leave_type.id)

0 commit comments

Comments
 (0)