Odoo Help

5

What is the difference between context and domain? [Closed]

By
odoo.ma by IBS Group
on 10/4/13, 5:27 PM 6,591 views

The Question has been closed

by
Sudhir Arya (SA)
on 10/06/2013 06:25:55

And can they be used interchangeably in some cases.

If possible to give a simple clear example.

7
Sudhir Arya (SA)
On 10/5/13, 3:23 PM

Context: is a dictionary which contains some information like: user language, company, timezone, etc by default. You can pass any kind of data/information in context as per your need either from xml or from py (mehtods) and then based on that extra information you can write your process code.

Domain: is a condition(s) which is used to filter your data or for searching. For more information about domain see this: How to filter datas in OpenERP using domain list.

1

Essentially - domain is a filter you cannot expand beyond - context is a filter you can expand to the point that domain allows.

Context is used to pass the filter parameters created by the user to functions. domain does not.

context is not a filter, it's a dictionary of arbitrary values that depends of the context/screen of the user. It's mostly used to change the value of some fields. (e.g. language, warehouse I am wroking it to change quantities available of products, ...)

Fabien Pinckaers (fp)
on 10/5/13, 4:17 AM

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

Question tools

1 follower(s)

Stats

Asked: 10/4/13, 5:27 PM
Seen: 6591 times
Last updated: 6/2/16, 1:04 AM