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

I have created a new model that refers to company_id and now i want to add restriction rule so user can only create and see only his company items. Is that possible to do? I've tried to write rule like this:
[( 'Raw_material_comp_id', '=', 'user.company_id.id')]
but after that all my items of "raw material" disappears and I can not create any new ones. Any help?

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

Solved just need to replace code:

[('raw_material_comp_id','child_of',[user.company_id.id])] [CORRECT]

Works fine.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 24
2543
1
thg 6 24
5013
1
thg 10 23
10694
1
thg 10 23
98
1
thg 8 23
2193