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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- 项目
- MRP
此问题已终结
2
回复
2778
查看
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!!
| 相关帖文 | 回复 | 查看 | 活动 | |
|---|---|---|---|---|
|
|
0
11月 25
|
3371 | ||
|
|
2
8月 25
|
3954 | ||
|
|
1
7月 25
|
1945 | ||
|
|
1
8月 25
|
1154 | ||
|
|
0
5月 25
|
2159 |