How to control form view record duplication
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ờ
Hi,
This attribute serves to control the availability of the "Duplicate" option for a record within the form view.
example:
<record id="product_product_view_form" model="ir.ui.view">
<field name="name">product.product.
<field name="model">product.product</
<field name="arch" type="xml">
<form duplicate="0">
<group>
<!-- Field for Product Name -->
<field name="name"/>
</group>
</form>
</field>
</record>
Hope it helps
Hi Alex
Use sql Constrains or Api Constrains to avoid these duplication
_sql_constraints = [
('name_uniq', 'UNIQUE (name)', 'You can not have two users with the same name !')
]
like these you can update each fields .
Regards
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ý