Odoo Help


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.


Summing Rows in Last Row!

Mazhar Iqbal Rana
on 1/21/15, 2:35 PM 515 views

I have column named Duration and on each row id 579 578 580 etc I have values in database. Now at Id 641, I need to add all the rows above this id that is: rows from 600 to 641 in duration cell. I tried below codes but none worked




1- self.write(cr,uid,641,{'duration':sum(duration)})

2- for rec in self.browse(cr, uid, ids, context=context): #cr.execute("SELECT count(duration) FROM activity_track WHERE id_d=641") #res = cr.fetchall()

3- self.write(cr,uid,641,{'duration':cr.execute("SELECT count(duration WHERE id=641) AS tot_ans FROM activity_track")})

activity_track is my table

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)


Asked: 1/21/15, 2:35 PM
Seen: 515 times
Last updated: 3/16/15, 8:10 AM