I really cannot understand what does it mean by context or contextual data in odoo and programming ,could some one help me understand it just simply !
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Hi Yahya,
It's like when we are having discussion.
If I suddenly say, "Hey, let's meet up at 3AM".
Question for you is do you know what 3AM that I refer to? I didn't give you any context (in this case let's say we are missing timezone as the context)
Therefore, I should let you know that it's 3AM UTC+7.
You might think that, then we should just add the field that receive the UTC+7 as input and proceed along, instead of using "context". Think it further if I am using Odoo in Indonesia (+7) and you are in somewhere with different utc. everytime you are requesting data it must be very annoying to keep informing the system manually that you are requesting from your timezone. That's why we have CONTEXT. it's written in the code and it explains to the system.
As conclusion, we use context to pass certain data where we want to inform our "function" in our Model without storing in database.
Hope the analogy makes sense. Feel free to confirm anything.
Oh ,Thanks this mean that contextual data is like any data but it is unique due to its special goal of use .
like time zone ,currency and so on ,is that correct ?
Yes, you got it. you can see and familiarize yourself with more examples from Odoo source code.
Hit upvote and solve button if this helps.
Thanks!
Thank you too much ,it is too much helpful for me.
My pleasure Yahya!
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
3
gru 17
|
11255 | ||
|
0
mar 24
|
1362 | ||
|
0
gru 23
|
2793 | ||
|
0
sty 24
|
4262 | ||
Pass context in calling of super method.
Rozwiązane
|
|
2
sty 19
|
21497 |