Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7600 มุมมอง

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