summaryrefslogtreecommitdiff
path: root/addons/resource/tests
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2018-03-08 15:20:15 +0100
committerRomainLibert <rli@odoo.com>2018-06-06 17:04:07 +0200
commitb6642f1b702fc32f765dfd24e855a652572a83e1 (patch)
tree31f128798ac25342f282647d5a507b29bbbba182 /addons/resource/tests
parentd8a5141c175005848f544b03740487fb16ac8428 (diff)
[IMP] hr_holidays: add support for taking leaves differently
We would like to be able to take leaves using different units, currently we only support taking leaves by hours because we use datetimes. We need to support three units: * days * half days * hours These units will be defined on the leave type. Task #40995 Closes #21760
Diffstat (limited to 'addons/resource/tests')
-rw-r--r--addons/resource/tests/test_resource.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/resource/tests/test_resource.py b/addons/resource/tests/test_resource.py
index a190878e730..d790a897ba8 100644
--- a/addons/resource/tests/test_resource.py
+++ b/addons/resource/tests/test_resource.py
@@ -325,7 +325,7 @@ class TestResMixin(TestResourceCommon):
datetime_tz(2018, 4, 6, 16, 0, 0, tzinfo=self.john.tz),
)
# still showing as 5 days because of rounding, but we see only 39 hours
- self.assertEqual(data, {'days': 5, 'hours': 39})
+ self.assertEqual(data, {'days': 4.875, 'hours': 39})
# Looking at John's calendar
@@ -335,7 +335,7 @@ class TestResMixin(TestResourceCommon):
datetime_tz(2018, 4, 2, 0, 0, 0, tzinfo=self.jean.tz),
datetime_tz(2018, 4, 6, 23, 0, 0, tzinfo=self.jean.tz),
)
- self.assertEqual(data, {'days': 1.5, 'hours': 13})
+ self.assertEqual(data, {'days': 1.375, 'hours': 13})
# Viewing it as Patel
# Views from 2018/04/01 11:00:00 to 2018/04/06 10:00:00
@@ -343,7 +343,7 @@ class TestResMixin(TestResourceCommon):
datetime_tz(2018, 4, 2, 0, 0, 0, tzinfo=self.patel.tz),
datetime_tz(2018, 4, 6, 23, 0, 0, tzinfo=self.patel.tz),
)
- self.assertEqual(data, {'days': 1.25, 'hours': 10})
+ self.assertEqual(data, {'days': 1.125, 'hours': 10})
# Viewing it as John
data = self.john.get_work_days_data(