Search code examples
odooodoo-8odoo-9

Make filter in Sale Oder based on other models field state


I want to add a filter to search view of sale order. It should filter order based on SO picking state.

For example, I want to filter SO that have pickings and pickings state is 'confirmed'

what are my options?

I did try to add a relation to field picking_ids.state but getting an error

openerp.osv.expression: Non-stored field sale.order.picking_ids cannot be searched.

Solution

  • Extend sale.order and create a new computed field which you can use in your filter and will be stored and depends on picking_ids.state