Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4813 มุมมอง

I tried this with several security group settings but it's not working.

I created new group and added the user to this group, then I created a new security group with this domain= [('supplier', '=', False)] and put the group in. 

Nothing happends, it only works when I don't define a group and let this rule global.


How can I fix this ? Is this an Odoo Bug?

อวตาร
ละทิ้ง

It should work, but can you explain exactly what you did?

คำตอบที่ดีที่สุด

This might be what is causing your problem.  Odoo 12 introduced a Record Rule that was designed to limit access to “private addresses”. It’s on the Contacts model (res.partner).

There are a pair of Record Rules:

1.  Allow access to “private addresses” for selected users

[('type', '=', 'private')]

2. Allow access for all users to other “non-private addresses”

['|', 
('type', '!=', 'private'),
('type', '=', False)
]

This Record Rule grants access to all internal users through the “Internal User” access group. This group is inherited by all application access groups.

The problem is that the second Record Rule effectively overrides other Record Rules for Contacts.

  • If you have created a Record Rules to limit access to suppliers:
    • a user who should not have access to suppliers would be granted access (because type will be blank).
      • They would also be able to access private addresses for customers and other types of contact!

That’s because access is granted if the conditions for ANY of the Group-specific rules are satisfied – and these can come from multiple access groups.

The solution is either to remove the two “private address” Record Rules or to replace them with several rules that cover all the combinations.

This would also explain why a global record rule would work.

https://odootricks.tips/record-rules

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 19
3499
Can't save custom settings แก้ไขแล้ว
2
ธ.ค. 22
6646
0
มี.ค. 15
3798
0
เม.ย. 24
1560
How to create a read only user / group แก้ไขแล้ว
3
มี.ค. 22
17458