Thursday, August 31, 2023

default view filter in odoo

 

 

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

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...