mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-27 00:32:05 +02:00
19.0 vanilla
This commit is contained in:
parent
a1137a1456
commit
e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions
27
odoo-bringout-oca-ocb-hr/hr/tests/test_hr_employee_public.py
Normal file
27
odoo-bringout-oca-ocb-hr/hr/tests/test_hr_employee_public.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.addons.mail.tests.common import mail_new_test_user
|
||||
from odoo.addons.hr.tests.common import TestHrCommon
|
||||
|
||||
|
||||
class TestHrEmployee(TestHrCommon):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
||||
cls.res_users_without_hr_right = mail_new_test_user(
|
||||
cls.env,
|
||||
email='nhr@example.com',
|
||||
login='nhr',
|
||||
groups='base.group_user,base.group_partner_manager',
|
||||
name='No HR Right',
|
||||
)
|
||||
|
||||
def test_access_related_field_to_hr_employee(self):
|
||||
# Check if a related field related to hr_employee is accessible.
|
||||
self.env['hr.employee.public'].with_user(self.res_users_without_hr_right).search([("email", "!=", False)])
|
||||
|
||||
def test_access_search_on_users_department(self):
|
||||
User = self.env['res.users'].with_user(self.res_users_without_hr_right)
|
||||
User.search([('employee_id.department_id', '=', 1)])
|
||||
Loading…
Add table
Add a link
Reference in a new issue