CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
HI I would like to ask you if you could please explain the anatomy of the Openerp domain filters. I have to use it my project. Please explain the anatomy and description of the following domain filter .
If you are having any resource concerning the same then please share it .
Thanks in advance ..
Domains are tuples, the structure is (field, operator, value).
Field is the data in the database, Operator is the comparison, = equal, != not equal, > greater than, < less than, etc. Value is the data you want to compare with the field, it can be another database field, a constant or a calculated value.
Typically when you send a domain into a function it is sent as an array so it must be contained with in brackets [ ] whether you have 1 or more tuples.
The default operator between tuples in the array is & (AND), to modify that you can use | to indicate OR
So in your example the domain is ['|',('order_id.user_id','=',user.id),('order_id.user_id','=',False)]
translated in to human: orders with the same user id OR a blank user id will be part of the domain.
Without seeing the rest of the code a better answer cannot be given on what exactly the domain will be because user.id is not known from that code alone.
About This Community
Odoo Training Center
|Asked: 9/25/13, 11:46 AM|
|Seen: 10368 times|
|Last updated: 3/16/15, 8:10 AM|