跳至内容
菜单
此问题已终结
1 回复
4294 查看

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?

形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
2
5月 24
1578
1
3月 21
4086
0
5月 25
3705
2
2月 23
4219
1
1月 23
2203