{"id":20,"date":"2023-02-28T04:08:00","date_gmt":"2023-02-28T04:08:00","guid":{"rendered":""},"modified":"2024-01-28T09:05:25","modified_gmt":"2024-01-28T09:05:25","slug":"how-to-define-search-view-in-odoo-16","status":"publish","type":"post","link":"https:\/\/pythonpower.in\/index.php\/2023\/02\/28\/how-to-define-search-view-in-odoo-16\/","title":{"rendered":"How To Define Search View In Odoo 16"},"content":{"rendered":"<\/p>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/pythonpower.in\/wp-content\/uploads\/2023\/02\/maxresdefault.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"720\" data-original-width=\"1280\" height=\"360\" src=\"http:\/\/pythonpower.in\/wp-content\/uploads\/2023\/02\/maxresdefault-300x169.jpg\" width=\"640\" \/><\/a><\/div>\n<p><\/p>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<p><\/p>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: large;\"><b>How To Define Search View In Odoo 16<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\">In Odoo 16, you can define a search view in a module&#8217;s XML file using the search tag. Here&#8217;s an example of how to define a search view for a model named patient.py:<\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b>&lt;record id=&#8221;view_hospital_patient_search&#8221; model=&#8221;ir.ui.view&#8221;&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8221;model&#8221;&gt;hospital.patient.search&lt;\/field&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8221;model&#8221;&gt;hospital.patient&lt;\/field&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8221;arch&#8221; type=&#8221;xml&#8221;&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;search&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><span style=\"font-size: medium;\"><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8217;name&#8217; filter_domain=&#8221;[&#8216;|&#8217;, &#8216;|&#8217;,(&#8216;name&#8217;, &#8216;ilike&#8217;, self),<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(&#8216;age&#8217;, &#8216;ilike&#8217;, self),&nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(&#8216;gender&#8217;, &#8216;ilike&#8217;, self)]&#8221;&nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><b style=\"font-size: large;\">string=&#8217;Patient_name&#8217;&gt;&lt;\/field&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8217;age&#8217;&gt;&lt;\/field&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8217;gender&#8217;&gt;&lt;\/field&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span style=\"font-size: medium;\"><b><br \/><\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><span style=\"font-size: medium;\"><b>&nbsp;<\/b><\/span><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;\/search&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;\/field&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;\/record&gt;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><br \/><\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><b><br \/><\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><\/span><\/p>\n<div style=\"clear: both; text-align: center;\"><span style=\"font-size: medium;\"><iframe loading=\"lazy\" allowfullscreen=\"\" height=\"366\" src=\"https:\/\/www.youtube.com\/embed\/07xMUn-wGm4\" width=\"528\" youtube-src-><\/iframe><\/span><\/div>\n<p><span style=\"font-size: medium;\"><br \/><b><br \/><\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\">In the search tag, you can add various search fields and filters to define the search criteria. Here&#8217;s an example of how to add a search field for the name field of the model:<\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><br \/><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: large;\"><b>How To Add Filters And Group By Options In Odoo Search<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b style=\"font-size: x-large;\">&nbsp;View || Odoo 16<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b style=\"font-size: x-large;\"><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\">In Odoo, you can add filters and group by options to your search view to make it more powerful and user-friendly. Here&#8217;s how to do it:<\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\"><br \/><\/span><\/p>\n<ol>\n<li style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\">Adding filters:<\/span><\/li>\n<li style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><span style=\"font-size: medium;\">To add filters, you can use the filter tag in your search view&#8217;s XML file. For example, if you want to add a filter for the name field of a model, you can use the following code:<\/span><\/li>\n<\/ol>\n<div>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b>record id=&#8221;view_hospital_patient_search&#8221; model=&#8221;ir.ui.view&#8221;&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8221;model&#8221;&gt;hospital.patient.search&lt;\/field&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8221;model&#8221;&gt;hospital.patient&lt;\/field&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8221;arch&#8221; type=&#8221;xml&#8221;&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;search&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8217;name&#8217; filter_domain=&#8221;[&#8216;|&#8217;, &#8216;|&#8217;,(&#8216;name&#8217;, &#8216;ilike&#8217;, self), (&#8216;age&#8217;, &#8216;ilike&#8217;, self), (&#8216;gender&#8217;, &#8216;ilike&#8217;, self)]&#8221; string=&#8217;Patient_name&#8217;&gt;&lt;\/field&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8217;age&#8217;&gt;&lt;\/field&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;field name=&#8217;gender&#8217;&gt;&lt;\/field&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;filter name=&#8221;filter_male&#8221; string=&#8221;Male&#8221; domain=&#8221;[(&#8216;gender&#8217;, &#8216;=&#8217;, &#8216;male&#8217;)]&#8221;&gt;&lt;\/filter&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;filter name=&#8221;filter_female&#8221; string=&#8221;Female&#8221; domain=&#8221;[(&#8216;gender&#8217;, &#8216;=&#8217;, &#8216;female&#8217;)]&#8221;&gt;&lt;\/filter&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;filter name=&#8221;filter_kids&#8221; string=&#8221;Kids&#8221; domain=&#8221;[(&#8216;age&#8217;, &#8216;&amp;lt;=&#8217;, &#8216;5&#8217;)]&#8221;&gt;&lt;\/filter&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;group expand=&#8221;0&#8243; string=&#8221;Group By&#8221;&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;filter string=&#8221;Gender&#8221; name=&#8221;group_by_gender&#8221; context=&#8221;{&#8216;group_by&#8217; : &#8216;gender&#8217;}&#8221;&gt;&lt;\/filter&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;\/group&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;\/search&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;\/field&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp; &nbsp; &nbsp; &nbsp; <\/span>&lt;\/record&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\">\n<div style=\"clear: both; text-align: center;\"><iframe loading=\"lazy\" allowfullscreen=\"\" height=\"346\" src=\"https:\/\/www.youtube.com\/embed\/dAnn_kamW20\" width=\"530\" youtube-src-><\/iframe><\/div>\n<p><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><b><br \/><\/b><\/p>\n<\/div>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\">In this code, the string attribute specifies the label of the filter, the name attribute is the internal name of the filter, and the domain attribute specifies the search criteria for the filter.<\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><\/p>\n<ol>\n<li style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\">Adding group by options:<\/li>\n<li style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\">To add group by options, you can use the groupby tag in your search view&#8217;s XML file. For example, if you want to add a group by option for the category_id field of a model, you can use the following code:<\/li>\n<\/ol>\n<div>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b>&lt;group expand=&#8221;0&#8243; string=&#8221;Group By&#8221;&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<\/span>&lt;filter string=&#8221;Gender&#8221; name=&#8221;group_by_gender&#8221; context=&#8221;{&#8216;group_by&#8217; : &#8216;gender&#8217;}&#8221;&gt;&lt;\/filter&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; min-height: 15px;\"><span><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/b><\/span><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<\/span>&lt;\/group&gt;<\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><br \/><\/b><\/p>\n<p style=\"font-family: &quot;Helvetica Neue&quot;; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;\"><b><br \/><\/b><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; How To Define Search View In Odoo 16 In Odoo 16, you can define&hellip;<\/p>\n","protected":false},"author":2,"featured_media":83,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","_joinchat":[]},"categories":[5],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/posts\/20"}],"collection":[{"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":1,"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":84,"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/posts\/20\/revisions\/84"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/media\/83"}],"wp:attachment":[{"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonpower.in\/index.php\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}