Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
7585 Vistas

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
Avatar
Descartar
Mejor respuesta

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
Avatar
Descartar
Autor

thank you very much, it is running