Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
7601 Переглядів

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
Аватар
Відмінити
Найкраща відповідь

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