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

 workorder_count = fields.Integer('# Work Orders', compute='_compute_workorder_count')

"workorder+=1"  it doesn't work

아바타
취소

Can You Explain Your Question in Brief?

베스트 답변

Hi,

workorder_count = fields.Integer('# Work Orders', compute='_compute_workorder_count')

The above line is field declaration and if you have to increment the value on the field workorder_count, write a function in the name you have mentioned in the compute "_compute_workorder_count".

@api.depends('workorder_count')
def _compute_workorder_count(self):
     self.workorder_count += 1


Thanks

아바타
취소
관련 게시물 답글 화면 활동
0
8월 22
2402
1
7월 22
20106
0
4월 22
3071
3
9월 21
3241
2
9월 21
4536