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

I want to know how to do difficult domains with operators, because if I have something easy as: 

(A & B) --> ['&', ('id', 'in', active_ids), ('partner_id', 'in', partner)]

I know to do it

But if I have

(A & B) | C 
or 
( (A & B) | C) |  (D & E) 
I don't know how to do it, because I don't know where I have to put the operators 
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Celia,

Odoo use polish notation to manage all filters and its operator between two filters. For that you need to have a look inside polish notation if you dont know anything about it. http://en.wikipedia.org/wiki/Polish_notation

From your question : ( (A & B) | C ) | (D & E) will be formed as like below to manage domain inside Odoo.


1) [ '|', '&', '|', '&', (A), (B), (C), (D), (E) ]

2) [ '|', '|', '&', (A), (B), (C), '&', (D), (E)  ] 

3) [ '|' , '&' , (D) , (E) , '|' , '&' , (A) , (B) , (C) ] 


I hope you will get exact idea that how domain is working in Odoo.




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

I guess the #1 results in:

(((A & B) | C) & D) | E

doesn't it?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
มิ.ย. 21
38766
1
ธ.ค. 20
2145
1
เม.ย. 18
7240
Why Odoo is so successful แก้ไขแล้ว
3
ก.ย. 15
9136
2
ส.ค. 15
4895