跳至內容
選單
此問題已被標幟
1 回覆
6388 瀏覽次數

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

頭像
捨棄
作者

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,

}

最佳答案

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>

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
10月 23
1133
4
10月 18
7877
3
6月 18
6507
2
12月 21
25583
1
12月 19
3149