Odoo Help

AJ Schrafel Paper Corp
On 9/26/13, 11:49 AM

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.

Francesco OpenCode
On 9/25/13, 11:52 AM

This is the system used to create the structure for the domain:


Study it (search Polish notation on a search engine) to understand this structure.

Hi thanks for the answer. but my actual concern is the anatomy .I want to know the exact meaning of (order_id.user_id','=',user.id) , what is order_id , user_id, and user.id. are they referencing any table . if yes then how am i supposed to know which one .... basically i want to know decipher the notation from bottom up so that can use it as per my requirement.

Mohd Ahmad
on 9/25/13, 12:13 PM

Hi Ahmad, if you want to know the meaning of order_id.user_id, here is my thought : in your entity that contain domain above, you have an attribute named order_id which typed as many2one with your another entity. So the "order_id.user_id" is refer to the user_id column in your another entity which referenced as many2one by the order_id attribute. As for the "user.id", I have no idea where is that come from, because your snippet code is too short. Hope this help.. :)

Akhmad Mizkat
on 11/27/13, 10:50 PM
Mohammed Mansour
On 2/5/15, 9:26 AM

You will find the answer here by @Ray Carnes

Really it's very good answer


and to read more about Openerp Polish notation open this link http://en.wikipedia.org/wiki/Polish_notation

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 9/25/13, 11:46 AM
Seen: 11516 times
Last updated: 3/16/15, 8:10 AM