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

I want to open pop up(wizard) by select specify item from selection 

but the @onchange function can't return 

The example:

@api.onchange('m')

    def _onchange_m(self):

             return {

                'type': 'ir.actions.act_window',

                'name': _('Reporting'),

                'res_model': 'hr.m',

                'view_type': 'form',

                'view_mode': 'form',

                'target': 'new',

            }

Someone have an idea how to do it?

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

The onchange method is meant to only populate other fields on the form when a value changes. To return a pop up you could use @api.constrains, which will run on record save, or put in additional logic on an existing method to return your pop up.

Ả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
1657
1
thg 3 21
4279
0
thg 5 25
3770
2
thg 2 23
4305
1
thg 1 23
2282