콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
330 화면

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

아바타
취소
관련 게시물 답글 화면 활동
4
10월 16
31286
1
9월 15
3948
1
6월 15
859
0
4월 15
696
2
4월 15
882