Creating Custom Search Panels in Odoo 18: A Practical Tutorial

December 17, 2024 by
admin


                                                                                                                 


Creating Custom Search Panels in Odoo 18: A Practical Tutorial


The search panel in Odoo 18 makes it easy to find and filter records within a module. It provides a simple interface for quickly locating data based on specific criteria, without needing to use the search bar or advanced filters. This feature is especially helpful when working with large amounts of data, making navigation and management faster and more user-friendly.
The search panel in Odoo lets users explore and filter data directly within a view by showing predefined categories. These categories can be based on various fields, such as many-to-one, many-to-many, or selection fields. This makes it simple to filter records quickly and efficiently without needing extra clicks or advanced search options.


Step by step guide on how to create search panel
 


Let’s consider the product template model and how the search panel is added in the model.
The following code snippet enables a search panel for products.


    
    <record id="product_template_search_panel" model="ir.ui.view">
      <field name="name">product.template.search.panel</field>
      <field name="model">product.template</field>
      <field name="inherit_id" ref="product.product_template_search_view"/>
      <field name="arch" type="xml">
        <search position="inside">
          <searchpanel>
              <field name="categ_id" icon="fa-filter" string="Category" select="multi"/>
              <field name="brand_id" icon="fa-filter" string="Brand" select="multi"/>
              <field name="type" icon="fa-files-o"/>
          </searchpanel>
        </search>
      </field>
    </record>
    


Features of this search panel includes
  1. Category and Brand Filters: Multi-select filtering with checkboxes.
  2. Type Filter: Filter by product type (e.g., stockable, consumable).
  3. Icons: Font Awesome icons (fa-filter, fa-files-o) for a visually appealing UI.


Conclusion
The search panel is an essential feature in Odoo 18, especially for modules managing large datasets. It simplifies data filtering and enhances user navigation, making the interface more intuitive and efficient. With Odoo's flexibility, adding and customizing a search panel for your module is quick and adaptable to your unique requirements, improving the overall user experience.


If you are looking for an ERP implementation partner with diverse industry experience feel free to contact us. We have proven track record of successful implementations across various sectors including Odoo for Manufacturing, Odoo for Trading, Odoo for FMCG, Odoo for Oil & Gas, Odoo for Diary, Odoo for Pharma, Odoo for Cosmetic Clinic, Odoo for Contracting Companies, Odoo for HVAC, Odoo for Logistics, Odoo for Automobile, Odoo for Laundry, Odoo for Field Service, Odoo for E-Commerce & many more


ZestyBeanz offers Developer / Consultant outsourcing programs, Chat with us in Whatsapp and Hire Odoo Developers, Mobile Application Developers, Consultants.
#OdooDevelopment #Odoo18  #OdooTips #Odoofeatures #ERPSolutions #OpenSourceERP #BusinessTechnology #SoftwareDevelopment #EnterpriseManagement #PythonDevelopment
in R&D
# R&D