I've added some custom fields to sale.order model. I also created a form view (which inherits from sale.view_order_form view) for creating a new sale order object. the problem is all created fields are as rows in the form view and I want some of them to go to another column. How can I change the form view to send some fields to another column instead of all being in a row?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hello ,
You can do this using group tag in form view in xml file.
With help of group tag you can separate the fields .
Please refer following example . you can get better idea....
<record id = "sale_order_view_form_inherit_form_1" model = "ir.ui.view" >
<field name = "name" > sale.order.form.inherit </field>
<field name = "model" > sale.order </ field >
<field name = "inherit_id" ref = "sale.view_order_form" />
<field name = "arch" type = "xml" >
<xpath expr = "//" position = "" >
<group>
<group>
<field name = "field1" />
<field name = "field2" />
</group>
<group>
<field name = "field3" />
<field name = "field4" />
</group>
</group>
</xpath>
</field>
</record>
you can use group tag :
<group name="parent">
<group name="child1">
<field name="field_name"/>
</group>
<group name="child2">
<field name="field_name"/>
</group>
</group>
can use colspan attribute for change columns of groups
Hi,
Please refer this,
<record id = "sale_order_view_form_inherit" model = "ir.ui.view" >
<field name = "name" > sale.order.form.inherit </field>
<field name = "model" > sale.order </ field >
<field name = "inherit_id" ref = "sale.view_order_form" />
<field name = "arch" type = "xml" >
<xpath expr = "//" position = "" >
<group>
<group>
<field name = "field_name" />
</group>
<group>
<field name = "field_name" />
</group>
</group>
</xpath>
</field>
</record>
Muhammed Ali M - iWesabe
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
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 | |
---|---|---|---|---|
|
1
thg 11 22
|
3377 | ||
|
1
thg 3 22
|
3302 | ||
|
1
thg 6 17
|
10829 | ||
|
2
thg 2 23
|
1970 | ||
Inherit from inherited view
Đã xử lý
|
|
5
thg 6 20
|
6759 |
Could you share the code of your form view? I believe you can use <xpath> to locate and modify the inherited view.