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

Hello,

I have a model project.product and One2many field in project.project:

products_ids = fields.One2many('project.product', 'project_id', string='Products')

In project.project i also have field 

allowed_managers = fields.Many2many('res.users', string='Allowed managers', groups="project.group_project_manager")

A record rule created for Project / Users group that applies to Create, Write, Delete":

['|', ('project_id.allowed_managers','in',[user.id]), ('project_id','=', False)] 

I need this rule to set Create,Write,Delete project.product for users that are added as managers in the project. The group Project / Users has only Read permission on model project.product.

With this permission i do not see the "Add an item" button in the form view.

If i enable Create permission for Project / Users, the user sees "Add an item" for product_ids of all Project records. 

Is it possible to show "Add an item" button only for users added in allowed_managers and hide the button for all other Project / Users ?


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 24
1818
4
thg 11 23
5850
0
thg 10 23
1656
0
thg 12 22
2537
2
thg 12 23
19209