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.

0

function to sum field

By
Souleymane Male
on 8/6/13, 10:31 AM 818 views

Hi. I do a function to add many field in one field (Total), but it doesǹt work, can you help me please? Thanks

def get_total(self, cr, uid, ids, field_name, arg, context):
res = []
total = 0
curat = self.browse(cr, uid, ids, context)
for cura in curat:
    total += cura.curativedigit
    res[cura.id] = total

return res
0

Hiral Patel (hip)

--Hiral Patel (hip)--
Tiny ERP Pvt Ltd
http://www.odoo.com
913
| 2 1 5
India
--Hiral Patel (hip)--


Hiral Patel (hip)
On 8/7/13, 5:27 AM

Hello,

Try code like:

def get_total(self, cr, uid, ids, field_name, arg, context):
    res = {}
    total = 0
    curat = self.browse(cr, uid, ids, context=context)
    for cura in curat:
        total += cura.curativedigit
        res[cura.id] = total
return res

thank you very much, it is running

Souleymane Male
on 8/14/13, 8:31 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: 8/6/13, 10:31 AM
Seen: 818 times
Last updated: 3/16/15, 8:10 AM