Skip to Content
Menu
This question has been flagged
1453 Views

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 ?


Avatar
Discard
Related Posts Replies Views Activity
0
Apr 24
399
4
Nov 23
4246
0
Oct 23
378
0
Dec 22
1334
2
Dec 23
17351