Skip to Content
Menu
This question has been flagged
1 Atsakyti
4405 Rodiniai

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?

Portretas
Atmesti
Best Answer

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.

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
geg. 24
1675
1
kov. 21
4290
0
geg. 25
3800
2
vas. 23
4327
1
saus. 23
2349