how can i add a custom button to the header section of the res.partner form view using xml and xpath?
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ờ
1
Trả lời
13851
Lượt xem
hello
You have to inherit the res.partner form and add header tag if not exist.
try like below sample code.
<record id="inherit_res_partner_form" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//form//sheet" position="before">
<header>
<button name="action_name" string="Text to display" type="button_type"/> # button_type like object/action
</header>
</xpath> </field>
</record>
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ý