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

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


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

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!

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

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 19
7716
2
thg 9 25
1923
1
thg 10 24
6683
2
thg 1 24
2163
2
thg 12 23
2107