Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4326 Lượt xem

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!

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 23
1721
0
thg 11 23
1307
2
thg 2 19
7949
0
thg 3 16
4307
2
thg 4 25
1302