Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
316 Prikazi

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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
4
okt. 16
31269
1
sep. 15
3928
1
jun. 15
844
0
apr. 15
690
2
apr. 15
868