title: Can't convert SQL to django query (having doesn't work)
body: <p>I have this SQL:</p>
  <pre><code>SELECT 
      stock_id, consignment_id, SUM(qty), SUM(cost) 
  FROM
      warehouse_regсonsignmentproduct
  WHERE
      product_id = '1'
  GROUP BY  
      stock_id, consignment_id
  HAVING
      SUM(qty) &gt; 0
  </code></pre>
  <p>I used django ORM to create this query:</p>
  <pre><code>regСonsignmentProduct.objects
      .filter(product='1')
      .order_by('period')
      .values('stock', 'consignment')
      .annotate(total_qty=Sum('qty'), total_cost=Sum('cost'))
      .filter(total_qty__gt=0)
  </code></pre>
  <p>But my django query returns an incorrect result.</p>
  <p>I think, the problem is in &quot;annotate&quot;</p>
  <p>Thanks!</p>