I need to count record with certain context.My code goes like this
@api.one
def sale_count(self):
count = self.env['sale.order'].search_count([('state', '=', 'sale')])
self.sale_order = count
And I need context as
'search_default_team_id': [active_id],
'default_team_id': active_id,