Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
332 Tampilan

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

Avatar
Buang
Jawaban Terbai

 


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'),

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
4
Okt 16
31288
1
Sep 15
3949
1
Jun 15
864
0
Apr 15
696
2
Apr 15
885