Odoo Help


Why this query returning None?

on 12/15/14, 2:20 AM 629 views

I am trying to get the sum() saled quantity of a product. For that i write the below query.

            """select sum(product_uom_qty) from sale_order_line where product_id=%d and state=%s"""

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.

Emipro Technologies Pvt. Ltd.
on 12/15/14, 5:56 AM



| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 12/15/14, 3:25 AM

hmm... maybe you should try something like...

self.cr.execute("some querry...")
res = cr.fetchall()

in your case out is only a querry, but you didn't fetch any data ...

also.. check this answer 
basicaly.. the same explanation...

Thank you Bole, working fine..

on 12/15/14, 8:02 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 12/15/14, 2:20 AM
Seen: 629 times
Last updated: 3/16/15, 8:10 AM