Domain in action window

  • Step 1:

    Use the domain display specific records in listview based on condition.

    For example to display only those orders which are in ‘sale’ state in sale order list view.

    
                   <record id="action_orders" model="ir.actions.act_window">
    
                    <field name="name">Sales Orders</field>
    
                    <field name="type">ir.actions.act_window</field>
    
                    <field name="res_model">sale.order</field>
    
                    <field name="view_type">form</field>
    
                    <field name="view_mode">tree,kanban,form,calendar,pivot,graph</field>
    
                    <field name="search_view_id" ref="view_sales_order_filter"/>
    
                    <field name="domain">[('state', 'in', (‘sale’))]</field>
    
                    </record>