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

Hi everyone!

I have a methad that triggers onchange like this:

    @api.onchange('patient_ids','variant_id','center', 'osocial')

    @api.multi

    def _check_osocial_centro_facturacion(self):


The thing is that this function alters some fields that aren't in the form and, when I create a new record, this works, but, when I update the record and change some of the fields that triggers the method, it doesn't save the fields in the database.

I checked, and the method works and Its been called when I update the record, but the problem is that it doesn't store the values.

What is the problem here?

Thanks!

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

If it is onchange and the fields you are changing are not in the view, please add them all in the view and make them invisible.

Onchange does not work if the field is not in the view. It must be in the view, does not matter it is visible or not.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 24
6510
1
thg 4 24
2787
1
thg 1 20
6185
2
thg 7 17
7477
1
thg 1 16
3618