Skip to Content
Menú
This question has been flagged
1 Respondre
343 Vistes

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
Descartar
Best Answer

 


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
Descartar
Related Posts Respostes Vistes Activitat
4
d’oct. 16
31293
1
de set. 15
3953
1
de juny 15
868
0
d’abr. 15
702
2
d’abr. 15
888