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

I have an one2many field imaged_ids, I am able to download images one by one using the following:

return {
'type': 'ir.actions.act_url',
'target': 'current',
'url': "web/content/?model=ir.attachment&id=" + str(attachment_id.id) + "&download=true&filename=" + attachment_id.name,
}

Now I need to show a button and download all images in a single click, is it possible? Can someone help me ut of this?

Thanks for the the help in advance.

頭像
捨棄
作者 最佳答案

I have solved the issue for now with a solution like in  javascript :

result.forEach(function(attachment) {
console.log(attachment);
var url = "web/content/?model=ir.attachment&id=" + attachment.id + "&download=true&filename=" + attachment.name;
window.open(url, '_blank');
});

Unless any other more effective solution comes up for this, I will continue with the above solution.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
3月 22
1727
1
11月 23
8371
0
5月 22
45
1
1月 21
3587
1
5月 21
4830