跳至內容
選單
此問題已被標幟
2 回覆
1268 瀏覽次數

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!

頭像
捨棄
作者 最佳答案

Hey Karan, 

it worked appreciate you.

Fares

頭像
捨棄
最佳答案

Hello Fares,

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


Regards,

Karan BK

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
1月 24
2955
0
1月 24
1397
1
9月 23
1139
1
11月 21
4313
0
5月 21
2514