Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
1285 Prikazi

Hello, Odoo community,


I'm relatively new to Odoo and would appreciate some guidance on an issue I'm facing with Record Rules. I've been working on restricting access to specific records using Record Rules, and it seems to work well when I apply a filter for a single ID like this: [('id', '!=', 1839)].


However, I've encountered difficulties when attempting to expand this to include multiple IDs in the filter. I've tried the following variations without success:

1. ['&', ('id', '!=', 1839), ('id', '!=', 1789)]

2. ['|', ('id', '!=', 1839), ('id', '!=', 1789)]


Despite these attempts, the records are not being filtered as expected. If anyone has experience with setting up Record Rules to restrict access based on multiple IDs, I would greatly appreciate your insights. Thank you for your help!

Avatar
Opusti
Avtor Best Answer

Hey Karan, 

it worked appreciate you.

Fares

Avatar
Opusti
Best Answer

Hello Fares,

Use [('id', 'not in', [1839, 1789)] instead. It's better to use not in operator for excluding multiple records. 


Regards,

Karan BK

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
jan. 24
2998
0
jan. 24
1414
1
sep. 23
1154
1
nov. 21
4327
0
maj 21
2528