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:
- CRM
- e-Commerce
- Financeiro
- Inventário
- PoS
- Projeto
- MRP
Esta pergunta foi sinalizada
2
Respostas
2711
Visualizações
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!!
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscreva-se| Publicações relacionadas | Respostas | Visualizações | Atividade | |
|---|---|---|---|---|
|
|
0
nov. 25
|
3280 | ||
|
|
0
out. 25
|
312 | ||
|
|
2
ago. 25
|
3854 | ||
|
|
1
jul. 25
|
1881 | ||
|
|
1
ago. 25
|
1154 |