Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4289 Zobrazení

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?

Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
kvě 24
1577
1
bře 21
4086
0
kvě 25
3705
2
úno 23
4215
1
led 23
2202