mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-25 06:52:02 +02:00
Initial commit: Hr packages
This commit is contained in:
commit
62531cd146
2820 changed files with 1432848 additions and 0 deletions
30
odoo-bringout-oca-ocb-hr/hr/tests/test_channel.py
Normal file
30
odoo-bringout-oca-ocb-hr/hr/tests/test_channel.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.addons.hr.tests.common import TestHrCommon
|
||||
|
||||
|
||||
class TestChannel(TestHrCommon):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestChannel, cls).setUpClass()
|
||||
|
||||
cls.channel = cls.env['mail.channel'].create({'name': 'Test'})
|
||||
|
||||
emp0 = cls.env['hr.employee'].create({
|
||||
'user_id': cls.res_users_hr_officer.id,
|
||||
})
|
||||
cls.department = cls.env['hr.department'].create({
|
||||
'name': 'Test Department',
|
||||
'member_ids': [(4, emp0.id)],
|
||||
})
|
||||
|
||||
def test_auto_subscribe_department(self):
|
||||
self.assertEqual(self.channel.channel_partner_ids, self.env['res.partner'])
|
||||
|
||||
self.channel.write({
|
||||
'subscription_department_ids': [(4, self.department.id)]
|
||||
})
|
||||
|
||||
self.assertEqual(self.channel.channel_partner_ids, self.department.mapped('member_ids.user_id.partner_id'))
|
||||
Loading…
Add table
Add a link
Reference in a new issue