Help

What is the difference between context and domain?

Closed
Avatar
IBS Group

The question has been closed

by
Sudhir Arya (ERP Harbor Consulting Services)
on 10/06/2013 06:25:55

And can they be used interchangeably in some cases.

If possible to give a simple clear example.

Avatar
Discard
2 Answers
9

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.

Avatar
Discard
1
Best Answer

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.

1 Comment
Avatar
Discard
Avatar
Fabien Pinckaers (fp)
-

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, ...)