In the blog we will explain how to add default view filter in odoo , just like the apps default filter in odoo apps view
Firstly : inside the search view you must define your default filter with the right domain , for example let us say we want to add default filter in product view to display products that can be sold only , just as bellow
<filter name="can_be_sold" string="Can Be Sold" domain="[('sale_ok', '=', ture)]"/>
Secondly : pass you filter to view you want using context , just as bellow
<field name="context">{'search_default_can_be_sold':1}</field>
No comments:
Post a Comment