Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
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
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/25/13, 11:46 AM|
|Seen: 10665 times|
|Last updated: 3/16/15, 8:10 AM|