跳至內容
選單
此問題已被標幟
1829 瀏覽次數

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?

頭像
捨棄
作者

Solved just need to replace code:

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

Works fine.

相關帖文 回覆 瀏覽次數 活動
2
7月 24
2533
1
6月 24
5010
1
10月 23
10692
1
10月 23
98
1
8月 23
2193