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

Hello, so I'm trying to learn relational database and I'm learning many2many right now. 

So I have an upper head and a lower head, and my conditional statement is "allowed users that are only lowerhead" but the problem is I can select the same user. 

Example.

Eunha = Upper Head
Anya = Lower Head


Now the problem is, Anya can select Anya herself because she is a lower head


This is my domain

[("x_studio_head", "=", "Lower Head")]


I'm trying to think is if user_id = to self, then don't include

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

In your case, please check if the field x_studio_head is a selection field. If it is a selection field, use the key of the corresponding selection field value in the domain. For example, if you define the field as shown below:
x_studio_head = fields.Selection([('lower_head', 'Lower Head'), ('upper_head', 'Upper Head')])

Then the domain should be:
[("x_studio_head", "=", "lower_head")]


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 25
2645
1
ก.ค. 25
1029
1
ส.ค. 25
1151
0
พ.ค. 25
1488
2
เม.ย. 25
3644