This question has been flagged
1 Reply
3949 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?

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

can u please give me one example with function definition

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

Author

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?