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

Hi everybody!!!

Please i want to add two fields type integer from the same class and to display it in a third field from the same classe. Can anyone help me please

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

 


def _add_numbers(self, cr, uid, ids, field_name, arg, context=None):

res = {}

for record in self.browse(cr, uid, ids, context=context):

       res[record.id] = record.number1 + record.number2

return res



'number1':fields.float('First Value'),

'number2':fields.float('Second Value'),

'result':fields.function(_add_numbers,method= True,type='float',string='Result'),

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
ต.ค. 16
31293
1
ก.ย. 15
3953
1
มิ.ย. 15
868
0
เม.ย. 15
702
2
เม.ย. 15
888