Maybe you don’t need this answer now, but if you read the documentation about Sum expression , you need to declare the output_field, like this:
Customer.objects.filter(something)
.annotate(total_spent=Sum(
F('order__lineitem__quantity') *
F('order__lineitem__price'),
output_field=models.FloatField()
))