Skip to Content
मेन्यू
This question has been flagged
2276 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
अप्रैल 24
1818
4
नव॰ 23
5851
0
अक्तू॰ 23
1656
0
दिस॰ 22
2538
2
दिस॰ 23
19209