Book Image

Odoo Development Essentials

Book Image

Odoo Development Essentials

Overview of this book

Table of Contents (17 chapters)
Odoo Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Context and domain


We have stumbled on context and domain several times. We have also seen that window actions are able to set values on them, and that relational fields can also use them in their attributes. Both concepts are useful to provide richer user interfaces. Let's see how.

Session context

The context is a dictionary carrying session data to be used by client-side views and by server processes. It can transport information from one view to another, or to the server-side logic. It is frequently used in window actions and relational fields to send information to the views opened through them.

Odoo sets some basic information about the current session on the context. The initial session information can look like this:

{'lang': 'en_US', 'tz': 'Europe/Brussels', 'uid': 1}

We have information on the current user ID and the language and time zone preferences for the user session.

When using an action on the client, such as clicking on a button, information about the currently selected records...