Hello, I was trying to understand decorator @api.dependens_context in odoo but I didn't find any document explaining it clearly can anyone explain it clearly with example and what is used for, Thanks and BR.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Proje Yönetimi
- MRP
Bu soru işaretlendi
2
Cevaplar
2708
Görünümler
Hi,
Here is the link to the documentation:
Hope it helps
Hello ZiadHamdii
We use the ''@api.depends_context'' decorator for non-stored ‘compute’ methods to indicate the context dependencies for these methods.
The arguments passed will be the key in the context’s dictionary.
example:
@api.depends_context('company')
def _compute_currency_id(self):
self.currency_id = self.env.company.currency_idThanks!!
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Ol| İlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
|---|---|---|---|---|
|
|
0
Kas 25
|
3277 | ||
|
|
0
Eki 25
|
312 | ||
|
|
2
Ağu 25
|
3853 | ||
|
|
1
Tem 25
|
1881 | ||
|
|
1
Ağu 25
|
1154 |