Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6763 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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,

}

Câu trả lời hay nhất

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>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 23
1658
4
thg 10 18
8439
3
thg 6 18
6983
2
thg 12 21
26310
1
thg 12 19
3577