hello i have parent model with field related to another model2 on2many
in form view i build form for model1
then add tree for model2 to add line i want pass some value from model1 to model 2 i write context but is not work
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
hello i have parent model with field related to another model2 on2many
in form view i build form for model1
then add tree for model2 to add line i want pass some value from model1 to model 2 i write context but is not work
Hi,
You can pass context like this:
<page name="sub_tasks_page" string="Sub-tasks" invisible="not project_id">
<field name="child_ids"
mode="list,kanban"
context="{
'default_project_id': project_id,
'default_display_in_project': False,
'default_user_ids': user_ids,
'default_parent_id': id,
'default_partner_id': partner_id,
'default_milestone_id': allow_milestones and milestone_id,
'kanban_view_ref': 'project.project_sub_task_view_kanban_mobile',
'closed_X2M_count': closed_subtask_count,
}"
widget="subtasks_one2many">
Thanks
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 | |
---|---|---|---|---|
|
2
thg 9 22
|
9244 | ||
|
2
thg 4 22
|
4226 | ||
|
0
thg 7 21
|
6916 | ||
|
1
thg 3 21
|
4675 | ||
|
5
thg 8 20
|
18561 |