Skip to Content
Menu
This question has been flagged
1839 Rodiniai

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?

Portretas
Atmesti
Autorius

Solved just need to replace code:

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

Works fine.

Related Posts Replies Rodiniai Veikla
2
liep. 24
2550
1
birž. 24
5018
1
spal. 23
10696
1
spal. 23
98
1
rugp. 23
2193