Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6506 Lượt xem

I am trying to inherit one group's access rights to another group in odoo using python code.

Example :-

i have a hr_manager group and restrict_user group.

i want to inherit hr_manager group to restrict_user group during creation of a new user.

Please suggest..

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

If you have a group A, then you can create/write a group B that inherit the access rights of A. 

self.env['res.groups'].create({'name': 'B', 'implied_ids': [(6, 0, A.ids)]})

implied_ids is a many2many field that does exactly what you need

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
7
thg 6 24
24698
0
thg 9 20
2231
1
thg 6 20
11546
0
thg 8 19
3765
0
thg 7 23
2