I am trying to get the sum() saled quantity of a product. For that i write the below query.
out=self.cr.execute(
"""select sum(product_uom_qty) from sale_order_line where product_id=%d and state=%s"""
%(product_id.id,'done'))
Ther is more than ten sales orders which are there in done state.
product_id is the browse record of product. But it's return None. Can any one tell me how can i get sum of saled quantity of product.
@samba can you post little bit more code, which may help to find the issue. You can try one thing instead of %d, let it be %s, it will not affect your code.