I created a new model. How to set up filters.
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 Alex
You can create filters based on your condition in the search view of the model
check this references
Regards
Hi,To set up filters in your model you can follow the below line of code.
<record id="model_name_search" model="ir.ui.view">
<field name="name">model.name.search<
<field name="model">model.name</
<field name="arch" type="xml">
<search string="Add String">
<field name="your_field_1" string="Add String" />
<field name="your_field_2" string="Add String"/>
#Add your specific field here
#You can also add a domain for each field to get corresponding records.
<filter string="New" name="state" domain="[('state','=','draft')
<filter string="Running" name="state" domain="[('state','=','
<filter string="Stopped" name="state" domain="[('state','=','
#Add group by field
<group expand="1" string="Group By">
<filter string="Target" name="model_id" context="{'group_by':'model_
</group>
</search>
</field>
</record>
Also refer our below blog
How to configure Search View , Filters & Group by in Odoo 16
Hope it helps
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ý