The output_field is going to cast the result of the multiplication expression. This implies that the multiplication is going to occur before the Cast can happen.
You would need to cast the two values before doing the multiplication, so that the database performs the operation on two bigint fields.
You’re looking for something like:
quantity = ExpressionWrapper(
Cast('deal_quantity', output_field=BigIntegerField()) *
Cast('product__product_quantity', output_field=BigIntegerField())
)
(I think I’ve got the parens all matched up here.)
Since the result of a multiplication between two bigints is a bigint, I don’t think you need to cast the result of that expression.