19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:00 +01:00
parent a1137a1456
commit e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions

View 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)])