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

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: [],
            });
        }
    }
},
頭像
捨棄

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

最佳答案

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

頭像
捨棄
作者 最佳答案

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

頭像
捨棄

check i have updated my code.

相關帖文 回覆 瀏覽次數 活動
4
9月 21
15823
2
3月 20
6970
0
1月 19
5529
1
4月 25
3406
0
3月 24
1274