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

The following javascript code opens a new page with the click event.How to change the code for a new dialog box popup of the same target form?

_onInfoBoxClicked: function (event) {
    if (!$(event.target).prop('special_click')) {
        var id = $(event.currentTarget).data('id');
        var ids = $(event.currentTarget).data('ids');
        if (id) {
            this.trigger_up('open_record',{id: id, target: event.target});
        }
        else if (ids.length){
            this.trigger_up('search', {
                domains: [[['id', 'in', ids]]],
                contexts: [],
                groupbys: [],
            });
        }
    }
},
Ảnh đại diện
Huỷ bỏ

i have updated my answer, you can inherit js and do it.

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

Hi,

check the event.target value if its is current . Change event.target value to new. 

you can pass static value if does not affect anything.

if (id) {
            this.trigger_up('open_record',{id: id, target: 'new'});
        }


let me know how it works.

Ex.


{
    "type": "ir.actions.act_window",
    "res_model": "product.product",
    "views": [[False, "form"]],
    "res_id": a_product_id,
    "target": "new",
}


Regards,

Silvestar

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

thank you for your reply, but where can I find/modify your code example?

Ảnh đại diện
Huỷ bỏ

check i have updated my code.

Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 9 21
15852
2
thg 3 20
6980
0
thg 1 19
5563
1
thg 4 25
3433
0
thg 3 24
1285