跳至内容
菜单
此问题已终结
2 回复
3254 查看

Hi,

It is possible to make a read only view of the opened maintenance requests of a specific maintenance team?

I want that the users can see their requests but can't modify the stage of then.


Thnks


形象
丢弃
编写者 最佳答案

Hi Ibrahim,

is possible to apply that view to a specific group of users?

for example, create a user group called “read only view”.

another inquire is... can i display that view in a specific link of the menu, like “Maintenance Requests Status”?

Thnks a lot!

形象
丢弃
最佳答案

Hi  Luis, 
1- Declare a boolean field :

fields_readonly = fields.Boolean(compute='compute_fields_readonly')

2- then if your function:

@api.multi

def compute_fields_readonly(self):     
user = self.env.user     

for record in self:         

    if user.has_group('module.your_maintenance_team_group'):  

        record.fields_readonly = True


3- in your view, add boolean to view with invisible="1" and attrs readonly if the boolean is true.
Hope this helps.

形象
丢弃
相关帖文 回复 查看 活动
2
3月 19
7723
2
9月 25
1934
1
10月 24
6804
2
1月 24
2175
2
12月 23
2131