-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raise AccessError if no employee is found for current user
- Loading branch information
1 parent
00f87c8
commit aaf723c
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
from odoo.tests.common import TransactionCase | ||
from odoo.tools import mute_logger | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class TestHrAttendanceOverTime(TransactionCase): | ||
|
@@ -610,6 +611,18 @@ def test_check_in_on_out_time(self): | |
self.assertFalse(attendance.is_overtime) | ||
self.assertFalse(attendance.attendance_reason_ids) | ||
|
||
def test_todays_working_times_user_without_employee(self): | ||
user = self.env["res.users"].create( | ||
{ | ||
"name": "Test User", | ||
"login": "test_user", | ||
"email": "[email protected]", | ||
"tz": "UTC", | ||
} | ||
) | ||
with self.assertRaises(UserError): | ||
self.employee.todays_working_times([("id", "=", user.id)]) | ||
|
||
def test_todays_working_times(self): | ||
self.maxDiff = None | ||
with freeze_time("2021-12-13 05:01", tz_offset=0): | ||
|