summaryrefslogtreecommitdiff
path: root/addons/resource/tests/common.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-09-11 18:07:49 +0200
committerChristophe Simonis <chs@odoo.com>2015-09-11 18:07:49 +0200
commit024177ebc4eace19e2ebab25dc8c4887079ebf75 (patch)
treee4fffd7a526fbb263bc2dddb63438b125908a0ce /addons/resource/tests/common.py
parentd48aa27cce6dca22d4f7d64942430f23b774fb18 (diff)
[FIX] resource: get_working_intervals_of_day
Use patch from 8.0 (64e1c28e358ec06a7683249fd7fae1ba631c1933) instead of the one from 7.0 (bbd15cdca6e3bf6c92d3e230a2b7697c801a2cfb).
Diffstat (limited to 'addons/resource/tests/common.py')
-rw-r--r--addons/resource/tests/common.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/addons/resource/tests/common.py b/addons/resource/tests/common.py
index 74b91abde2e..a82bf70b708 100644
--- a/addons/resource/tests/common.py
+++ b/addons/resource/tests/common.py
@@ -29,8 +29,9 @@ class TestResourceCommon(common.TransactionCase):
def setUp(self):
super(TestResourceCommon, self).setUp()
cr, uid = self.cr, self.uid
- if not hasattr(self, 'context'):
- self.context = {}
+ self.context = context = dict(tz='UTC')
+
+ self.registry('res.users').write(cr, uid, uid, {'tz': 'UTC'}, context=context)
# Usefull models
self.resource_resource = self.registry('resource.resource')
@@ -56,7 +57,7 @@ class TestResourceCommon(common.TransactionCase):
self.calendar_id = self.resource_calendar.create(
cr, uid, {
'name': 'TestCalendar',
- }
+ }, context=context
)
self.att1_id = self.resource_attendance.create(
cr, uid, {
@@ -65,7 +66,7 @@ class TestResourceCommon(common.TransactionCase):
'hour_from': 8,
'hour_to': 16,
'calendar_id': self.calendar_id,
- }
+ }, context=context
)
self.att2_id = self.resource_attendance.create(
cr, uid, {
@@ -74,7 +75,7 @@ class TestResourceCommon(common.TransactionCase):
'hour_from': 8,
'hour_to': 13,
'calendar_id': self.calendar_id,
- }
+ }, context=context
)
self.att3_id = self.resource_attendance.create(
cr, uid, {
@@ -83,7 +84,7 @@ class TestResourceCommon(common.TransactionCase):
'hour_from': 16,
'hour_to': 23,
'calendar_id': self.calendar_id,
- }
+ }, context=context
)
self.resource1_id = self.resource_resource.create(
cr, uid, {
@@ -91,7 +92,7 @@ class TestResourceCommon(common.TransactionCase):
'resource_type': 'user',
'time_efficiency': 150.0,
'calendar_id': self.calendar_id,
- }
+ }, context=context
)
self.leave1_id = self.resource_leaves.create(
cr, uid, {
@@ -99,7 +100,7 @@ class TestResourceCommon(common.TransactionCase):
'calendar_id': self.calendar_id,
'date_from': self.leave1_start,
'date_to': self.leave1_end,
- }
+ }, context=context
)
self.leave2_id = self.resource_leaves.create(
cr, uid, {
@@ -108,7 +109,7 @@ class TestResourceCommon(common.TransactionCase):
'resource_id': self.resource1_id,
'date_from': self.leave2_start,
'date_to': self.leave2_end,
- }
+ }, context=context
)
self.leave3_id = self.resource_leaves.create(
cr, uid, {
@@ -117,7 +118,7 @@ class TestResourceCommon(common.TransactionCase):
'resource_id': self.resource1_id,
'date_from': self.leave3_start,
'date_to': self.leave3_end,
- }
+ }, context=context
)
# Some browse data
- self.calendar = self.resource_calendar.browse(cr, uid, self.calendar_id)
+ self.calendar = self.resource_calendar.browse(cr, uid, self.calendar_id, context=context)