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

Hey. I have made a custom module and by using that i have a custom view for portal user and i am doing that using controllers. I have what i want but that record is read only for him. How can i give write access to him? Kindly help. Thanks in advance

Right now i am trying the following line of code


@http.route('/my_attend_detail',type='http',auth='public',website=True)
def attend_rights(self,attend_detail=None):
attend_detail = request.env ['op.attendance.line'].browse()
try:
attend_detail.check_access_rights('write')
attend_detail.check_access_rule('write')
except AccessError:
return request.website.render("website.403")
return request.render('attendance_website.attend_detail_temp',{'my_attend':attend_detail})
Ảnh đại diện
Huỷ bỏ

can you drop your template code here

Câu trả lời hay nhất

Hey, have you found a solution?

Ảnh đại diện
Huỷ bỏ
Tác giả

Nothing yet man!

Câu trả lời hay nhất

Hi!

You can add a group that can access the object "attend_detail"(by create,write..) and then add your portal user to this group so that he can make some changes on the data that is being passed by the controller to the template, to achieve this :
- create a group :Settings->users & companies >groups>create,

-on the Access rights tab select the rights that you want your portal user to have and select  the object in your  case "op.attendance.line",

-add your portal user to this group on Users tab,

(or you can easily add your portal user to the admin group which is not a practical solution),

good luck!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 20
6014
1
thg 3 19
3711
4
thg 3 19
10381
1
thg 4 19
8444
3
thg 3 19
8850