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

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

 


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
Publicaciones relacionadas Respuestas Vistas Actividad
4
oct 16
31289
1
sept 15
3951
1
jun 15
865
0
abr 15
700
2
abr 15
885