Skip to Content
Menu
This question has been flagged
1 Reply
5984 Views

Hi everybody,


I need to open a wizard after clicking on a button AND several processes.

Eg: "my_button" -> "my_button_function" -> "another_function_to_open_wizard"

But each time I try to create a wizard by this way, nothing show up. If I put the python code to open the wizard in the first function (the one directly depending on the button), it works. But if the code for the wizard is in a separated function, there is nothing...

The problem is, I need to have separated functions, I can't do it in another way, so why the wizard doesn't show up, and how to make it work properly ?

I precise, the code is correctly executed, and it goes in the wizard function, but just return anything...


Thanks by advance

Avatar
Discard
Author

Something like that Benoit Vézina, I did this : return {

'name': _('Send order request'),

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

'view_type': 'form',

'view_mode': 'form',

'res_model': 'purchase.order.alt',

'views': [(view.id, 'form')],

'view_id': view.id,

'nodestroy': True,

'target': 'new',

'res_id': wiz.id,

'context': self.env.context,

}

Best Answer

did you try to return an action at the end like

<code>

return {
            'name':_("Products to Process"),
            'view_mode': 'form',
            'view_id': False,
            'view_type': 'form',
            'res_model': 'stock.partial.move',
            'res_id': partial_id,
            'type': 'ir.actions.act_window',
            'nodestroy': True,
            'target': 'new',
            'domain': '[]',
            'context': context
        }

</code>

Avatar
Discard
Related Posts Replies Views Activity
0
Oct 23
593
4
Oct 18
7107
3
Jun 18
5862
2
Dec 21
24315
1
Dec 19
2633