Odoo Help

Welcome!

This community 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.

1

how to select data from database?

By
aneesh ATEES Infomedia Pvt Ltd
on 2/26/15, 1:48 AM 566 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?

1
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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