I am trying to pass a list of order_ids to .filtered so as to exclude them from my recordset but I seem to be getting an error global name "order_ids" is not defined. Below is an example of my code.
active_ids = ['34','35',36']
p = self.env['stock.pack.operation']
p_obj = p.search([['id','in',active_ids]])
order_ids = ['1','2','3']
p_obj.filtered(lambda r: r.origin_id.id IN order_ids)
This issue is regarding Odoo 9.
Thanks for your reply. I wanted to use filtered so I could filter the recordset already being used rather than creating a completely new recordset.