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

How can you display a popup form when a button is pressed?

Which are the basic steps? Can anyone provide an example?

Thanks,

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

Hi E.M,

You can add  button like this in you XML file.

<button name="action_from view" string="Open View" type="object"/> 

You need to define your view here


In Your py


def action_from view(self, cr, uid, ids, context=None):


"Your Code"


        return {

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

'view_type': 'form',

'view_mode': 'form',

'res_model': 'mail.compose.message'    # name of respective model,

'views': [(compose_form_id, 'form')],    # view id and type

'view_id': compose_form_id, # view id 

'target': 'new',

'context': context,

}



Thanks

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

Still basic doubts about how to achieve it: https://www.odoo.com/forum/help-1/question/developing-a-new-popup-in-stock-picking-basic-doubts-about-how-to-generate-the-popup-97625

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

You can find a very nice explanation in detail on how to do this on stackoverflow

http://stackoverflow.com/questions/31940425/pop-up-the-window-of-exsiting-view-through-click-event-in-odoo

Edit according to your needs.

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

Still basic doubts about how to achieve it: https://www.odoo.com/forum/help-1/question/developing-a-new-popup-in-stock-picking-basic-doubts-about-how-to-generate-the-popup-97625

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 21
8288
1
thg 2 16
8070
0
thg 2 16
3864
4
thg 5 23
10540
1
thg 1 19
9644