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

I have a wizard in which I am returning pdf document report with 'ir.actions.act_url' for download popup. It works fine, but the problem is that the wizard window needs to be closed as well after it. I can do that via 'ir.actions.act_window_close', but I can't return two actions at once.

I've heard there is a way to do it with 'ir.action.server' with multi attribute, but I couldn't make it work. Is there any particular and simple example about how to use it for my problem?


close_action = {'type': 'ir.actions.act_window_close'}

dl_action = {

    'type': 'ir.actions.act_url',

    'url': '/documents/download?document_id={}'.format(document.id),
    'target': 'self'

}

return dl_action

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hey, it doesn't work with 'new' either, but thanks for replying Nikul.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Mr.Peter Markus

Please change target parameter "new", I think it's helpful for you.
return {
            'type': 'ir.actions.act_url',
            'url': '/documents/download?document_id={}'.format(document.id),
            'target': 'new',
        }

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 23
1512
1
thg 2 24
9606
2
thg 3 23
2509
0
thg 3 15
6009
1
thg 12 22
6199