['|',('user_id','=',user.id),('user_id','=',False)]

Asked by Bushair

Hi,

What does the following Record Rules mean?

1)['|',('user_id','=',user.id),('user_id','=',False)]

2)['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id]),('company_id.child_ids','child_of',[user.company_id.id])]

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Nhomar - Vauxoo
Solved:
Last query:
Last reply:
Revision history for this message
Husen Daudi (husendaudi) said :
#1

Hello Bushair,

Most of the questions are already answered here or in forum.
Please try to find out something in sources and if you still found problem you can ask here.

Check this for more details on this question.
https://answers.launchpad.net/openobject-server/+question/143194

Revision history for this message
Best Nhomar - Vauxoo (nhomar) said :
#2

Source[1]

This parameter allows you to regulate which resources are visible in a selected view.(restriction)

For example, in the invoice case, you can define an action that opens a view that shows only invoices not paid.

The domains are written in python; list of tuples. The tuples have three elements;

        * the field on which the test must be done
        * the operator used for the test (<, >, =, like)
        * the tested value

For example, if you want to obtain only ‘Draft’ invoice, use the following domain; [(‘state’,’=’,’draft’)]

In the case of a simple view, the domain define the resources which are the roots of the tree. The other resources, even if they are not from a part of the domain will be posted if the user develop the branches of the tree.

###########For your specific case##############
['|',('user_id','=',user.id),('user_id','=',False)]

the '|' become the domain in an "or" statement.
It means "all records than the user_id field is the connected one _or_ not have user related"

The other one is somthing like this. a little more complicated but _or_ too!
[1] http://doc.openerp.com/v5.0/developer/2_7_menu_action/7_2_actions.html?highlight=domain

Regards.

Revision history for this message
Bushair (bushairka) said :
#3

Thanks all