Odoo Help


how to select data from database?

aneesh ATEES Infomedia Pvt Ltd
on 2/26/15, 1:48 AM 640 views

i have to calculate the total amount of claims in my custome module.so  i want to knwo that how to calculate the total amount of claims in my calim table. how it is posilble?is there anyfuction to done database retrivel of data?

Mariusz Mizgier
On 2/26/15, 2:07 AM

Easiest way in old API would be self.pool.get('crm.claim').search(cr, uid, [], count=True), so you will receive number of all records in crm_claim table.

can u please give me one example with function definition

aneesh ATEES Infomedia Pvt Ltd
on 2/26/15, 2:30 AM

def count_claims(self, cr, uid, ids, context=None) return self.pool.get('crm.claim').search(cr, uid, [], count=True) Like so?

Currenda Sp. z o.o., Mariusz Mizgier
on 2/26/15, 2:34 AM

return self.pool.get('amount.claim').search(cr, uid, [], count=True) AttributeError: 'NoneType' object has no attribute 'search'--this is the error.pls help me how to select amount from claim?

aneesh ATEES Infomedia Pvt Ltd
on 2/26/15, 3:59 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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

1 follower(s)


Asked: 2/26/15, 1:48 AM
Seen: 640 times
Last updated: 3/16/15, 8:10 AM