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

Hi, 

I need to updates values of "Column B" based on "Column A" and an user input.

For that I would need to present the user with some kind of "Calculate" button and a wizard where the user will enter a desired % and then Column B values will appear.

I am not asking exactly how can I do this, right now I would like to know if this is possible? Where should I look at? How can I create a "calculate" button?

Any tip will be appreciated!

 

아바타
취소
베스트 답변

you can use @api.onchange('field_a')


    @api.onchange('field_a')
    def _onchange_field_a(self):
        if self.field_a:
            self.field_b = some_value_after_calculation

This method will be called whenever there is a change in value of field_a and will update value of field_b. No button is required.

아바타
취소
관련 게시물 답글 화면 활동
2
11월 23
1700
0
11월 23
1294
2
2월 19
7939
0
3월 16
4302
2
4월 25
1292