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

Hello, 


I have a call declared with a 


@api.one
@api.depends('field1', 'field2')
def _compute_availibility(self):

inside a class which is part of a one2many relation.  I want to calculate a sum from values typed in previous lines, tried with 


self_values = self.search([('domain')])


but  values are always zeros, I believe it's because I can get only values from current line, since its a new line, all values are zero.


How can I access values from previous lines?




Thank you

아바타
취소
베스트 답변

Make compute on the one2many field, not on lines and you will get the full lines and can add data accordingly.

아바타
취소
관련 게시물 답글 화면 활동
1
1월 20
4024
0
3월 15
4385
0
3월 15
4077
1
7월 25
704
Search a message 해결 완료
1
2월 25
1378