Hi Odoo developers.
What is the purpouse of using the context attribute inside a field tag in a form view?.
<form>
....
<field name="field_name" context=? .. />
....
</form>
Thanks in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi Odoo developers.
What is the purpouse of using the context attribute inside a field tag in a form view?.
<form>
....
<field name="field_name" context=? .. />
....
</form>
Thanks in advance.
If you want to specify the views to use, you can add a context attribute, and specify a view id for each type of view supported, exactly like the action's view_id attribute:
<field name="order_line" colspan="4" nolabel="1"
context="{'form_view_ref' : 'module.view_id', 'tree_view_ref' : 'model.view_id'}"/>
you can check here :-
https://doc.odoo.com/6.0/developer/2_6_views_events/views/specify_view_to_use/
Thank you
Thank you for your answer Ankit, but I'm not sure if this works with Odoo 8. The link you wrote is for OpenERP 6.
check this link https://www.odoo.com/forum/help-1/question/whats-the-context-2236
I review your link but it doesn't explained how to use context inside a field but inside a button. This is more logical because a button can be linked to a Python method passing the context inside the button tag, but a field tag can not bounded to any method.
for relational fields only, context to pass when fetching possible values
The context of the view that apply to the tree view. Here, a default filter is applied, the filter_see_all filter we created earlier. So we will see all cashiers.
use the context parameter self.context to retrieve the current session.
merged into the view's context when performing the button's Odoo call
https://www.odoo.com/documentation/8.0/reference/views.html
Sorry but I don't understand what you want to say. Any example would be welcomed.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 4 24
|
44 | ||
|
1
thg 4 15
|
7790 | ||
|
0
thg 8 22
|
3285 | ||
|
1
thg 11 19
|
4966 | ||
|
2
thg 11 18
|
5185 |
How to to use context: http://learnopenerp.blogspot.com/2018/01/get-parent-form-value-in-one2many-form.html